Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-09 23:06:00 +0000
committerStijn Buys <ingar@osirion.org>2008-02-09 23:06:00 +0000
commit31959bc355c471c573828bf63932850e46c4b5bc (patch)
treecc473901e88926e36c89775a7fc97a51da948498 /src/core/entity.h
parentd281384f727583b39b8e97ffea58b278ecc8dd47 (diff)
more entities
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h86
1 files changed, 69 insertions, 17 deletions
diff --git a/src/core/entity.h b/src/core/entity.h
index ef9168b..8efb2aa 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -7,45 +7,97 @@
#ifndef __INCLUDED_CORE_ENTITY_H__
#define __INCLUDED_CORE_ENTITY_H__
+#include "core/core.h"
+#include "core/player.h"
#include "math/mathlib.h"
#include <vector>
namespace core
{
+namespace entity
+{
+
+/// Entity flags
+enum Flags {Static=1};
+
+/// Entity type constants
+enum Type {None = 0, Dynamic = 1, Controlable = 2};
+
+}
+
/// The base world entity. All gameworld entities must derive from this class.
-class Entity {
+class Entity
+{
public:
/// create a new entity and add it to the registry
- Entity(unsigned int entity_type, unsigned int entity_flags=0);
+ Entity(unsigned int entity_flags = 0, unsigned int entity_type = entity::None);
virtual ~Entity();
-
- /// core id of the entity
+
+ /// id of the entity
unsigned int id;
+ /// flags
+ unsigned int flags;
+
+ /// type
+ unsigned int type;
+
+ /// base shape
+ unsigned int base_shape;
+
+ /// base color
+ math::Color base_color;
+
+ /// label
+ std::string label;
+
+ /* updateable */
+
/// location of the entity
math::Vector3f location;
+};
- /// flags
- unsigned int flags;
+/// an entity that can move
+class EntityDynamic : public Entity
+{
+public:
+ EntityDynamic(unsigned int entity_flags = 0, unsigned int entity_type=entity::Dynamic);
- /// type
- unsigned int type;
+ /* updateable */
+
+ /// speed vector, in game units / second
+ math::Vector3f speed;
};
-namespace entity {
+/// an entity that can be controlled by a player
+class EntityControlable : public EntityDynamic
+{
+public:
+ EntityControlable(unsigned int entity_flags = 0, unsigned int entity_type=entity::Controlable);
+
+ /// owner of this controllable entity
+ Player *owner;
+};
+
+
+namespace entity
+{
+
+/// base entity shapes
+enum Shapes {Diamond=0, Cube=1, Sphere=2};
- /// the entity registry
- extern std::vector<Entity*> registry;
+/// the entity registry
+extern std::vector<Entity*> registry;
- /// add an entity to the registry
- void add(Entity *ent);
+/// add an entity to the registry
+void add(Entity *ent);
- /// clear the entity registry
- void clear();
+/// clear the entity registry
+void clear();
- /// list the entity registry
- void list();
+/// list the entity registry
+void list();
}
}