From 9d39702824e8fae5127e09fb5a05b521b48cd028 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 9 Nov 2008 11:43:28 +0000 Subject: docking menus --- src/core/entity.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index 09b52a1..2e3b443 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "model/model.h" #include "math/axis.h" @@ -24,6 +25,7 @@ class EntityControlable; } #include "core/clientstate.h" +#include "core/descriptions.h" #include "core/player.h" #include "core/zone.h" @@ -46,6 +48,9 @@ public: /// EntityDynamic event state classes enum Event {Normal=0, NoPower=1, ImpulseInitiate=2, Impulse=3, JumpInitiate=4, Jump=5, Docked=6}; + /// entity menus collection typedef + typedef std::list Menus; + /// create a new entity and add it to the registry Entity(unsigned int flags = 0); @@ -117,6 +122,12 @@ public: /// general visibility inline bool visible() const { return entity_visible; } + /// entity menus + inline Menus &menus() { return entity_menus; } + + /// find a menu + MenuDescription *find_menu(std::string const &label); + /*----- serializers ----------------------------------------------- */ /// serialize the entity to a stream @@ -191,6 +202,12 @@ public: /// unset a flag void unset_flag(Flags flag); + /// add an entity menu + void add_menu(MenuDescription *menu); + + /// remove an entity menu + void remove_menu(std::string const &label); + /// clear all update flags virtual void clear_updates(); @@ -252,6 +269,8 @@ private: model::Model *entity_model; std::string entity_modelname; + Menus entity_menus; + static Registry entity_registry; static size_t entity_nextid; -- cgit v1.2.3