From 8f124fabdfd6761cefbcc2c4120ba325692f5d0b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 22 Apr 2012 19:48:27 +0000 Subject: Initial support for per-entity weapon slots. --- src/core/entity.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index d071c06..77bc2d8 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -30,6 +30,7 @@ class EntityControlable; #include "core/label.h" #include "core/physics.h" #include "core/player.h" +#include "core/slots.h" #include "core/zone.h" namespace core @@ -195,6 +196,11 @@ public: return entity_inventory; } + /// entity weapon slots + inline Slots *slots() const { + return entity_slots; + } + /// entity info inline const Info *info() const { return entity_info; @@ -329,12 +335,24 @@ public: * @brief add an inventory to this entity * If this entity already has an inventory, * the current inventory will be return - */ + * */ Inventory *add_inventory(); + + /** + * @brief add equipment slots to this entity + * If this entity already has slots, + * the current slots will be returned. + * */ + Slots *add_slots(); + /** + * @brief set the information record for this entity + * */ void set_info(const Info *info); - /// set the timestamp when the entity was last alive + /** + * @brief set the timestamp when the entity was last alive + * */ void set_keepalive(unsigned long timestamp) { entity_keepalive = timestamp; } @@ -499,6 +517,7 @@ private: Menus entity_menus; Inventory* entity_inventory; + Slots* entity_slots; const Info* entity_info; Extension* entity_extension[4]; @@ -746,6 +765,9 @@ public: /// set afterburner/reverse void set_afterburner(float afterburner); + + /// set aim + void set_target_aim(const math::Vector3f &aim); /** * @brief runs one game frame for the entity @@ -793,6 +815,8 @@ protected: float target_strafe; float target_vstrafe; + + math::Vector3f target_aim; int entity_control_flags; -- cgit v1.2.3