Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::en::Entity Class Reference

This is the base class for entity system in KGE. More...

#include <Entity.h>

Inheritance diagram for kge::en::Entity:
kge::KgeUnknown

Public Member Functions

 Entity (int ID)
 Constructor.
 ~Entity ()
 Destructor.
int GetID ()
 Returns the entity ID.
void AddComponent (Component *pCmp)
 Adds a component to the entity.
ComponentGetComponent (int iCmpID)
 Returns a component by its ID.
std::vector< Component * > GetComponents (int iCmpID)
 Returns a list of components by its ID.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Public Attributes

int Type
 Entity type.

Protected Attributes

std::map< int, std::vector
< Component * > > 
m_vComponents
 The list of components.
std::map< int, std::vector
< Component * > >::iterator 
m_itComponents
 The helper iterator.
int m_iID
 Entity ID.

Additional Inherited Members

- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Detailed Description

This is the base class for entity system in KGE.

Definition at line 15 of file Entity.h.

Constructor & Destructor Documentation

kge::en::Entity::Entity ( int  ID)

Constructor.

kge::en::Entity::~Entity ( )

Destructor.

Member Function Documentation

void kge::en::Entity::AddComponent ( Component pCmp)

Adds a component to the entity.

Component* kge::en::Entity::GetComponent ( int  iCmpID)

Returns a component by its ID.

std::vector<Component*> kge::en::Entity::GetComponents ( int  iCmpID)

Returns a list of components by its ID.

Use this function when your entity has multi instance of one component

int kge::en::Entity::GetID ( )
inline

Returns the entity ID.

Definition at line 26 of file Entity.h.

Member Data Documentation

int kge::en::Entity::m_iID
protected

Entity ID.

Definition at line 47 of file Entity.h.

std::map<int, std::vector<Component*> >::iterator kge::en::Entity::m_itComponents
protected

The helper iterator.

Definition at line 46 of file Entity.h.

std::map<int, std::vector<Component*> > kge::en::Entity::m_vComponents
protected

The list of components.

Definition at line 45 of file Entity.h.

int kge::en::Entity::Type

Entity type.

Definition at line 41 of file Entity.h.


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