diff options
Diffstat (limited to 'src/core/entity.h')
-rw-r--r-- | src/core/entity.h | 19 |
1 files changed, 19 insertions, 0 deletions
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 <iostream> #include <string> #include <map> +#include <list> #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<MenuDescription *> 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; |