diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-18 17:58:45 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-18 17:58:45 +0000 |
commit | 35613f0860a2d8cb643ca8de006de08503e48e53 (patch) | |
tree | 8a5436de643e818e68a82df2e5cb2df2145f5062 /src/core/entity.h | |
parent | db287e4a5133125bb6f25ba21ea97c47b19ac67f (diff) |
example module
Diffstat (limited to 'src/core/entity.h')
-rw-r--r-- | src/core/entity.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/core/entity.h b/src/core/entity.h index 4861b07..2c4814e 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -117,6 +117,9 @@ public: /// indicates a server-side entity inline bool serverside() const { return entity_serverside; } + /// general visibility + inline bool visible() const { return entity_visible; } + /*----- serializers ----------------------------------------------- */ /// serialize the entity to a stream @@ -148,6 +151,9 @@ public: */ virtual void frame(float seconds); + /// set dirty flag + inline void set_dirty() { entity_dirty = true; } + /// set the zone the entity is currently in /** * this fuction removes the entity from its previous zone @@ -159,13 +165,22 @@ public: void set_label(char const *label); /// set the label - void set_label(std::string const &label); + void set_label(const std::string &label); /// set the name void set_name(char const *name); /// set the name - void set_name(std::string const &name); + void set_name(const std::string &name); + + /// set visibility + void set_visible(bool visible = true); + + /// show the entity, make it visible + virtual void show(); + + /// hide the entity, make it invisible + virtual void hide(); /// clear all update flags virtual void clear_updates(); @@ -218,6 +233,7 @@ protected: // the previous zone the entity belonged too Zone *entity_oldzone; + bool entity_visible; bool entity_serverside; std::string entity_name; @@ -232,7 +248,6 @@ private: // the entity registry static Registry entity_registry; - static size_t entity_nextid; }; |