From d8be908233fd7b85492d7a9e87f07bb207173990 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 25 Nov 2012 12:06:13 +0000 Subject: Moved core::EntityGlobe into a separate file, added various methods to core::Item and core::Slot, added r_slots cvar to draw entity slots and docks, added game methods for mounting and umounting of weapons, added playerlist to chat window. --- src/core/slot.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/core/slot.h') diff --git a/src/core/slot.h b/src/core/slot.h index 2d636b3..5cfeb3e 100644 --- a/src/core/slot.h +++ b/src/core/slot.h @@ -22,7 +22,7 @@ namespace core * */ class Slot { public: - enum Flags {Active = 1}; + enum Flags {Mounted = 1, Active = 2}; /** * @brief default constructor @@ -51,6 +51,30 @@ public: return slot_axis; } + /** + * @brief slot flags + * */ + inline const unsigned int flags() const + { + return slot_flags; + } + + /** + * @brief return true if a specified flag is set + * */ + inline const bool has_flag(const Flags flag) + { + return ( (slot_flags & flag) == flag ); + } + + /** + * @brief the item this slot is holding + * */ + inline core::Item *item() + { + return slot_item; + } + /** * @brief timestamp indicating when the slot was last fired,server-side * This is a server-side property @@ -127,6 +151,16 @@ public: slot_axis.assign(axis); } + /** + * @brief set a specified flags + * */ + void set_flag(const Flags flag); + + /** + * @brief unset a specified flags + * */ + void unset_flag(const Flags flag); + /** * @brief set the slot's timestamp * The timestamp indicates when the slot's configuration was last changed. -- cgit v1.2.3