|
Hymn to Beauty
C++ 3D Engine
|
Component controlled by a script. More...
#include <Script.hpp>
Public Member Functions | |
| Script () | |
| Create new script. More... | |
| ~Script () final | |
| Destructor. More... | |
| void | Serialize (Json::Value &node, bool load) override |
| Save or load component values to/from JSON. More... | |
| void | AddToPropertyMap (const std::string &name, int type, int size, void *data) |
| Add a property to the propertyMap. More... | |
| void | CopyDataFromPropertyMap (const std::string &name, void *target) |
| Copy the data from a property in the map. More... | |
| void * | GetDataFromPropertyMap (const std::string &name) |
| Get the pointer to the data of a property in the map. More... | |
| bool | IsInPropertyMap (const std::string &name, const int type) |
| Is the property in the map? More... | |
| void | ClearPropertyMap () |
| Clears the property map. More... | |
Public Member Functions inherited from Component::SuperComponent | |
| SuperComponent () | |
| Create new SuperComponent. More... | |
| virtual | ~SuperComponent () |
| Destructor. More... | |
| void | Kill () |
| Kill the component, will be removed at the end of the frame. More... | |
| bool | IsKilled () const |
| Get whether component has been killed. More... | |
Public Attributes | |
| bool | initialized = false |
| Whether the script component has been initialized. More... | |
| ScriptFile * | scriptFile = nullptr |
| The script file. More... | |
| asIScriptObject * | instance = nullptr |
| The instance of the script class. More... | |
Public Attributes inherited from Component::SuperComponent | |
| Entity * | entity = nullptr |
| Pointer to which entity this component corresponds. More... | |
Component controlled by a script.
| Script::Script | ( | ) |
Create new script.
|
final |
Destructor.
| void Script::AddToPropertyMap | ( | const std::string & | name, |
| int | type, | ||
| int | size, | ||
| void * | data | ||
| ) |
Add a property to the propertyMap.
| name | The name of the property. |
| type | The asTypeID of the property. |
| size | The size in number of bytes of the property. |
| data | A pointer to the data to store. |
| void Script::ClearPropertyMap | ( | ) |
Clears the property map.
| void Script::CopyDataFromPropertyMap | ( | const std::string & | name, |
| void * | target | ||
| ) |
Copy the data from a property in the map.
| name | The name of the property. |
| target | A pointer that points where to copy the data. |
| void * Script::GetDataFromPropertyMap | ( | const std::string & | name | ) |
Get the pointer to the data of a property in the map.
| name | The name of the property. |
| bool Script::IsInPropertyMap | ( | const std::string & | name, |
| const int | type | ||
| ) |
Is the property in the map?
| name | The name of the property. |
| type | The asTypeID of the property. |
|
overridevirtual |
Save or load component values to/from JSON.
| node | The JSON node to save to or load from. |
| load | Whether to load (otherwise saves). |
Implements Component::SuperComponent.
| bool Component::Script::initialized = false |
Whether the script component has been initialized.
| asIScriptObject* Component::Script::instance = nullptr |
The instance of the script class.
| ScriptFile* Component::Script::scriptFile = nullptr |
The script file.