diff options
Diffstat (limited to 'src/core/entity.h')
-rw-r--r-- | src/core/entity.h | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/src/core/entity.h b/src/core/entity.h index 6ff3be1..b3dd7ef 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -12,7 +12,6 @@ namespace core class EntityControlable; } -#include "core/core.h" #include "core/player.h" #include "math/mathlib.h" @@ -43,9 +42,7 @@ public: Entity(unsigned int entity_flags = 0); virtual ~Entity(); - /** - * @brief core type id - */ + /// core type id virtual inline unsigned int core_type() { return entity::Default; } /// unique instance identifier, automaticly set @@ -54,19 +51,20 @@ public: /// core shape id entity::Shape core_shape; - /// core color id + /// core color math::Color core_color; /// core radius, in game units float core_radius; - /// label + /// the entities label std::string label; /// custom game type id of this entity unsigned int type; /// flags + /// @see core::entity::Flags unsigned int flags; /* updateable by game */ @@ -74,72 +72,54 @@ public: /// location of the entity math::Vector3f location; - /** - * @brief direction the entity is facing, in degrees - * A direction of 0 degrees means the entity is 'looking' - * along the positive X-axis. - */ + /// direction the entity is facing, in degrees + /// A direction of 0 degrees means the entity is looking + /// along the positive X-axis. float direction; }; -/** - * @brief an entity that can move around in the game world - */ +/// an entity that can move around in the game world class EntityDynamic : public Entity { public: EntityDynamic(unsigned int entity_flags = 0); virtual ~EntityDynamic(); - /** - * @brief core type id - */ + /// core type id virtual inline unsigned int core_type() { return entity::Dynamic; } /* updateable by game */ - /** - * @brief current speed of the entity in game units per second - */ + /// current speed of the entity in game units per second float speed; }; -/** - * @brief an entity that can be controlled by a player - */ +/// an entity that can be controlled by a player class EntityControlable : public EntityDynamic { public: EntityControlable(unsigned int entity_flags = 0); virtual ~EntityControlable(); - /** - * @brief core type id - */ + /// core type id virtual inline unsigned int core_type() { return entity::Controlable; } - /** - * @brief owner of this controllable entity - */ + /// runs one game frame for the entity, to be implemented by game + virtual void frame(float seconds) = 0; + + /* updateable by game */ + + /// owner of this controllable entity Player *owner; /* updatable by client */ - /** - * @brief the direction the client wants to travel the entity to - * @see direction - */ + /// the direction the client wants to travel the entity to + /// @see direction float target_direction; - /** - * @brief engine thrust as set by the client, 0.0f - 1.0f - */ + /// engine thrust as set by the client, 0.0f - 1.0f float target_thrust; - - /** - * @brief runs one game frame for the entity, to be implemented by game - */ - virtual void frame(float seconds) = 0; }; |