Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Variables
Entity.h File Reference
#include "lib/types.h"

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)

Definition at line 60 of file Entity.h.

#define ENTITY_IS_NORMAL (   id)    (((id) & ENTITY_TAGMASK) == 0)

Definition at line 59 of file Entity.h.

#define ENTITY_TAGMASK   (1 << 29)

Definition at line 58 of file Entity.h.

Typedef Documentation

typedef u32 entity_id_t

Entity ID type.

ID numbers are never reused within a simulation run.

Definition at line 24 of file Entity.h.

Variable Documentation

const entity_id_t FIRST_LOCAL_ENTITY = ENTITY_TAGMASK

Definition at line 61 of file Entity.h.

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.

Definition at line 36 of file Entity.h.

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.)

Definition at line 44 of file Entity.h.