From 0cf596e0505f1198748931787b93f469f3e58db7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 14 Nov 2012 16:03:19 +0000 Subject: Add more Slot properties, corrected a bug in EntityControlable control flags handling. --- src/core/slot.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 9 deletions(-) (limited to 'src/core/slot.h') diff --git a/src/core/slot.h b/src/core/slot.h index d0f2fdc..6b6c47b 100644 --- a/src/core/slot.h +++ b/src/core/slot.h @@ -22,6 +22,8 @@ namespace core * */ class Slot { public: + enum Flags {Active = 1}; + /** * @brief default constructor * Creates an empty slot @@ -59,6 +61,27 @@ public: * projectiles generated by this slot * */ + /** + * */ + inline unsigned long last_fired() const + { + return slot_last_fired; + } + + inline unsigned long interval() const + { + return slot_interval; + } + + inline unsigned long lifespan() const + { + return slot_lifespan; + } + + inline float speed() const + { + return slot_speed; + } /* --- mutators -------------------------------------------- */ @@ -86,28 +109,60 @@ public: { slot_timestamp = timestamp; } - + + /** + * @brief + * */ + inline void set_last_fired(unsigned long last_fired) + { + slot_last_fired = last_fired; + } + + inline void set_interval(unsigned long interval) + { + slot_interval = interval; + } + + inline void set_lifespan(unsigned long lifespan) + { + slot_lifespan = lifespan; + } + + inline void set_speed(float speed) + { + slot_speed = speed; + } + /** * @brief set the item this slot is holding * */ - inline void set_item(Item *item); + void set_item(Item *item); private: math::Vector3f slot_location; + math::Axis slot_axis; + + // slot flags + unsigned int slot_flags; unsigned long slot_timestamp; - // FIXME consolidate into slot_flags - bool slot_active; - std::string slot_particlesystem_name; + unsigned long slot_last_fired; - // fire rate, in projectiles per second - float slot_fire_rate; - // fire range, in game units - float slot_fire_range; + // interval between two shots, in milliseconds + unsigned long slot_interval; + // projectile lifespane + unsigned long slot_lifespan; + + // projectile speed, in gameunits / second + float slot_speed; + + // item mounted in this slot Item *slot_item; + + std::string slot_particlesystem_name; }; } // namespace core -- cgit v1.2.3