Pyrogenesis  trunk
Classes | Macros | Typedefs | Variables
Entity.h File Reference
#include "lib/types.h"
Include dependency graph for Entity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SEntityComponentCache
 
class  CEntityHandle
 Object wrapping an entity_id_t, with a SEntityComponentCache to support fast QueryInterface() / CmpPtr<>() calls. More...
 

Macros

#define ENTITY_TAGMASK   (1 << 29)
 
#define ENTITY_IS_NORMAL(id)   (((id) & ENTITY_TAGMASK) == 0)
 
#define ENTITY_IS_LOCAL(id)   (((id) & ENTITY_TAGMASK) == ENTITY_TAGMASK)
 

Typedefs

typedef u32 entity_id_t
 Entity ID type. More...
 

Variables

const entity_id_t INVALID_ENTITY = 0
 Invalid entity ID. More...
 
const entity_id_t SYSTEM_ENTITY = 1
 Entity ID for singleton 'system' components. More...
 
const entity_id_t FIRST_LOCAL_ENTITY = ENTITY_TAGMASK
 

Macro Definition Documentation

#define ENTITY_IS_LOCAL (   id)    (((id) & ENTITY_TAGMASK) == ENTITY_TAGMASK)
#define ENTITY_IS_NORMAL (   id)    (((id) & ENTITY_TAGMASK) == 0)
#define ENTITY_TAGMASK   (1 << 29)

Typedef Documentation

typedef u32 entity_id_t

Entity ID type.

ID numbers are never reused within a simulation run.

Variable Documentation

const entity_id_t FIRST_LOCAL_ENTITY = ENTITY_TAGMASK
const entity_id_t INVALID_ENTITY = 0

Invalid entity ID.

Used as an error return value by some functions. No valid entity will have this ID.

const entity_id_t SYSTEM_ENTITY = 1

Entity ID for singleton 'system' components.

Use with QueryInterface to get the component instance. (This allows those systems to make convenient use of the common infrastructure for message-passing, scripting, serialisation, etc.)