|
NWengine 0.9
|
Class representing a game object. More...
#include <GameObject.h>
Public Member Functions | |
| GameObject () | |
| Default constructor for GameObject. | |
| GameObject (const GameObject &other) | |
| Copy constructor for GameObject. | |
| ~GameObject () | |
| Destructor for GameObject. | |
| int | Draw () |
| Draw the game object. | |
| void | SetDrawCallback (DrawCallback callback) |
| Set the draw callback for the game object. | |
| void | DeleteComponent (std::string typeName) |
| Delete a component from the game object. | |
| void | DeleteComponents () |
| Delete all components from the game object. | |
| int | Serialize (std::fstream *data, int offset) |
| Serialize the game object. | |
| int | Deserialize (std::fstream *data, int offset) |
| Deserialize the game object. | |
| template<typename T > | |
| T * | GetComponent () |
| Get a component of the specified type. | |
| template<typename T > | |
| T * | AddComponent () |
| Add a component of the specified type to the game object. | |
| GameComponent * | AddComponent (std::string type) |
| GameComponent * | GetComponent (std::string type) |
| Get a component of the specified type. | |
| template<typename T > | |
| void | DeleteComponent () |
| Delete a component of the specified type. | |
Public Member Functions inherited from Serialized | |
| Serialized () | |
| Default constructor for Serialized class. | |
Public Attributes | |
| std::map< std::string, GameComponent * > | components |
| std::string | name = "new GameObject" |
| uint32 | id = 0 |
| DrawCallback | _drawProc = nullptr |
Class representing a game object.
| GameObject::GameObject | ( | const GameObject & | other | ) |
Copy constructor for GameObject.
| other | The GameObject to copy. |
Add a component of the specified type to the game object.
| T | The type of the component. |
Delete a component of the specified type.
| T | The type of the component. |
| void GameObject::DeleteComponent | ( | std::string | typeName | ) |
Delete a component from the game object.
| typeName | The type name of the component to delete. |
Deserialize the game object.
| data | The file stream to deserialize from. |
| offset | The offset in the file stream. |
Reimplemented from Serialized.
| int GameObject::Draw | ( | ) |
Draw the game object.
Get a component of the specified type.
| T | The type of the component. |
| GameComponent * GameObject::GetComponent | ( | std::string | type | ) |
Get a component of the specified type.
| type | The type of the component. |
Serialize the game object.
| data | The file stream to serialize to. |
| offset | The offset in the file stream. |
Reimplemented from Serialized.
| void GameObject::SetDrawCallback | ( | DrawCallback | callback | ) |
Set the draw callback for the game object.
| callback | The draw callback to set. |
| DrawCallback GameObject::_drawProc = nullptr |
The draw callback for the game object.
| std::map<std::string, GameComponent*> GameObject::components |
Map of components attached to the game object.
| uint32 GameObject::id = 0 |
The identifier of the game object.
| std::string GameObject::name = "new GameObject" |
The name of the game object.