Aether3D Game Engine
Classes | Public Member Functions | Static Public Attributes | List of all members
ae3d::GameObject Class Reference

GameObject is composed of components that define its behavior. More...

#include <GameObject.hpp>

Public Member Functions

template<class T >
void AddComponent ()
 Adds a component into the game object. There can be multiple components of the same type.
 
template<class T >
void RemoveComponent ()
 Remove a component from the game object.
 
template<class T >
T * GetComponent () const
 
 GameObject ()=default
 Constructor.
 
 GameObject (const GameObject &other)
 Copy constructor.
 
GameObjectoperator= (const GameObject &go)
 
void SetName (const char *aName)
 
void SetEnabled (bool enabled)
 
bool IsEnabled () const
 
const std::string & GetName () const
 
void SetLayer (unsigned aLayer)
 
unsigned GetLayer () const
 
std::string GetSerialized () const
 

Static Public Attributes

static const unsigned InvalidComponentIndex = 99999999
 Invalid component index.
 

Detailed Description

GameObject is composed of components that define its behavior.

Member Function Documentation

template<class T >
T* ae3d::GameObject::GetComponent ( ) const
inline
Returns
The first component of type T or null if there is no such component.
unsigned ae3d::GameObject::GetLayer ( ) const
inline
Returns
Layer.
const std::string& ae3d::GameObject::GetName ( ) const
inline
Returns
Game Object's name.
std::string ae3d::GameObject::GetSerialized ( ) const
Returns
Game Object's contents excluding components
bool ae3d::GameObject::IsEnabled ( ) const
Returns
True if this game object and all its parents are enabled.
GameObject& ae3d::GameObject::operator= ( const GameObject go)
Parameters
goOther game object.
void ae3d::GameObject::SetEnabled ( bool  enabled)
inline
Parameters
enabledTrue if the game object should be rendered, false otherwise.
void ae3d::GameObject::SetLayer ( unsigned  aLayer)
inline
Parameters
aLayerLayer for controlling camera visibility etc. Must be power of two (2, 4, 8 etc.)
void ae3d::GameObject::SetName ( const char *  aName)
inline
Parameters
aNameGame Object's name.

The documentation for this class was generated from the following file: