diff options
Diffstat (limited to 'src/core/entity.h')
-rw-r--r-- | src/core/entity.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/core/entity.h b/src/core/entity.h new file mode 100644 index 0000000..ef9168b --- /dev/null +++ b/src/core/entity.h @@ -0,0 +1,53 @@ +/* + core/entity.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2. +*/ + +#ifndef __INCLUDED_CORE_ENTITY_H__ +#define __INCLUDED_CORE_ENTITY_H__ + +#include "math/mathlib.h" +#include <vector> + +namespace core +{ + +/// The base world entity. All gameworld entities must derive from this class. +class Entity { +public: + /// create a new entity and add it to the registry + Entity(unsigned int entity_type, unsigned int entity_flags=0); + virtual ~Entity(); + + /// core id of the entity + unsigned int id; + + /// location of the entity + math::Vector3f location; + + /// flags + unsigned int flags; + + /// type + unsigned int type; +}; + +namespace entity { + + /// the entity registry + extern std::vector<Entity*> registry; + + /// add an entity to the registry + void add(Entity *ent); + + /// clear the entity registry + void clear(); + + /// list the entity registry + void list(); +} + +} + +#endif // __INCLUDED_CORE_ENTITY_H__ |