ProtoZed  awesome branch
A simple but powerful game framework
Public Member Functions | Friends | List of all members
PZ::MetaEntity Class Reference

Meta entity. Used as a proxy to the EntityManager. More...

Public Member Functions

 MetaEntity ()
 Constructs an invalid object, to be used as a null object.
 
 ~MetaEntity ()
 
const EntityIDGetID () const
 Gets the identifier.
 
EntityManagerGetManager () const
 Gets the manager.
 
bool IsValid () const
 Query if this object is valid.
 
bool StillExists () const
 Queries if this entity still exists.
 
bool Destroy ()
 Destroys this entity.
 
template<class T >
T * AddComponent ()
 Adds a component.
 
ComponentAddComponent (const HashString &family)
 Adds a component.
 
template<class T >
bool RemoveComponent ()
 Removes a component.
 
bool RemoveComponent (const HashString &family)
 Removes a component.
 
template<class T >
bool HasComponent () const
 Query if the entity has a component.
 
bool HasComponent (const HashString &family) const
 Query if the entity has a component.
 
template<class T >
T * GetComponent () const
 Gets a component.
 
ComponentGetComponent (const HashString &family) const
 Gets a component.
 
void GetAllComponents (ComponentList &list) const
 Gets all components.
 
bool operator== (const MetaEntity &other)
 
bool operator!= (const MetaEntity &other)
 

Friends

class EntityManager
 

Detailed Description

Meta entity. Used as a proxy to the EntityManager.

Constructor & Destructor Documentation

PZ::MetaEntity::MetaEntity ( )
inline

Constructs an invalid object, to be used as a null object.

PZ::MetaEntity::~MetaEntity ( )
inline

Member Function Documentation

template<class T >
T* PZ::MetaEntity::AddComponent ( )
inline

Adds a component.

Returns
null if it fails, else the component.
Component* PZ::MetaEntity::AddComponent ( const HashString family)
inline

Adds a component.

Parameters
familyThe family of the component.
Returns
null if it fails, else.
bool PZ::MetaEntity::Destroy ( )
inline

Destroys this entity.

Returns
true if it succeeds, false if it fails.
void PZ::MetaEntity::GetAllComponents ( ComponentList list) const
inline

Gets all components.

Parameters
[in,out]listThe list.
template<class T >
T* PZ::MetaEntity::GetComponent ( ) const
inline

Gets a component.

Returns
null if it fails, else the component.
Component* PZ::MetaEntity::GetComponent ( const HashString family) const
inline

Gets a component.

Parameters
familyThe family of the component.
Returns
null if it fails, else the component.
const EntityID& PZ::MetaEntity::GetID ( ) const
inline

Gets the identifier.

Returns
The identifier.
EntityManager& PZ::MetaEntity::GetManager ( ) const
inline

Gets the manager.

Returns
The manager.
template<class T >
bool PZ::MetaEntity::HasComponent ( ) const
inline

Query if the entity has a component.

Returns
true if it has the component, false if not.
bool PZ::MetaEntity::HasComponent ( const HashString family) const
inline

Query if the entity has a component.

Parameters
familyThe family of the component.
Returns
true if it has the component, false if not.
bool PZ::MetaEntity::IsValid ( ) const
inline

Query if this object is valid.

Returns
true if valid, false if not.
bool PZ::MetaEntity::operator!= ( const MetaEntity other)
inline
bool PZ::MetaEntity::operator== ( const MetaEntity other)
inline
template<class T >
bool PZ::MetaEntity::RemoveComponent ( )
inline

Removes a component.

Returns
true if it succeeds, false if it fails.
bool PZ::MetaEntity::RemoveComponent ( const HashString family)
inline

Removes a component.

Parameters
familyThe family of the component.
Returns
true if it succeeds, false if it fails.
bool PZ::MetaEntity::StillExists ( ) const
inline

Queries if this entity still exists.

Returns
true if it does, false if it does not.

Friends And Related Function Documentation

friend class EntityManager
friend

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