Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
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

◆ ENTITY_IS_LOCAL

#define ENTITY_IS_LOCAL (   id)    (((id) & ENTITY_TAGMASK) == ENTITY_TAGMASK)

◆ ENTITY_IS_NORMAL

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

◆ ENTITY_TAGMASK

#define ENTITY_TAGMASK   (1 << 29)

Typedef Documentation

◆ entity_id_t

typedef u32 entity_id_t

Entity ID type.

ID numbers are never reused within a simulation run.

Variable Documentation

◆ FIRST_LOCAL_ENTITY

const entity_id_t FIRST_LOCAL_ENTITY = ENTITY_TAGMASK

◆ INVALID_ENTITY

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.

◆ SYSTEM_ENTITY

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