Handles scripting.
More...
#include <ScriptManager.hpp>
◆ BuildAllScripts()
| void ScriptManager::BuildAllScripts |
( |
| ) |
|
Build all scripts in the hymn.
◆ BuildScript()
| int ScriptManager::BuildScript |
( |
ScriptFile * |
script | ) |
|
Build a script that can later be run.
- Parameters
-
- Returns
- The result, < 0 means it failed.
◆ ClearKilledComponents()
| void ScriptManager::ClearKilledComponents |
( |
| ) |
|
Remove all killed components.
◆ CreateScript()
Create script component.
- Returns
- The created component.
◆ ExecuteScriptMethod()
| void ScriptManager::ExecuteScriptMethod |
( |
const Entity * |
entity, |
|
|
const std::string & |
method |
|
) |
| |
Execute a method on a script.
- Parameters
-
| entity | Target entity whose script will be run. |
| method | Method to call. |
◆ FillFunctionVector()
| void ScriptManager::FillFunctionVector |
( |
ScriptFile * |
scriptFile | ) |
|
Fetches the functions from the script and fills the scriptfiles vector.
- Parameters
-
| scriptFile | The scriptfile which vector to update. |
◆ FillPropertyMap()
Fetches the properties from the script and fills the map.
- Parameters
-
| script | The script which map to update. |
◆ GetScripts()
Get all script components.
- Returns
- All script components.
◆ GetStringDeclarationID()
| int ScriptManager::GetStringDeclarationID |
( |
| ) |
|
Used to get the string identifier used to check if a property is a string.
- Returns
- The identifier of the string declaration.
◆ GetUpdateEntities()
| const std::vector< Entity * > & ScriptManager::GetUpdateEntities |
( |
| ) |
|
Get the set of entities with a script component that accepts update events.
- Returns
- Entities with script updates.
◆ RegisterInput()
| void ScriptManager::RegisterInput |
( |
| ) |
|
◆ RegisterUpdate()
| void ScriptManager::RegisterUpdate |
( |
Entity * |
entity | ) |
|
Register an entity to recieve update callbacks.
- Parameters
-
| entity | Entity to register. |
- Todo:
- Fix so registered entities can be removed.
◆ SendMessage()
| void ScriptManager::SendMessage |
( |
Entity * |
recipient, |
|
|
Entity * |
sender, |
|
|
int |
type |
|
) |
| |
Send a message to an entity.
- Parameters
-
| recipient | The entity to receive the message. |
| sender | The entity that sent the message. |
| type | The type of message to send. |
◆ Update()
| void ScriptManager::Update |
( |
World & |
world, |
|
|
float |
deltaTime |
|
) |
| |
Update all script entities in the game world.
- Parameters
-
| world | The world to update. |
| deltaTime | Time since last frame (in seconds). |
◆ Hub
◆ currentEntity
| Entity* ScriptManager::currentEntity |
The entity currently being executed.
The documentation for this class was generated from the following files: