Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-10-18 17:58:45 +0000
committerStijn Buys <ingar@osirion.org>2008-10-18 17:58:45 +0000
commit35613f0860a2d8cb643ca8de006de08503e48e53 (patch)
tree8a5436de643e818e68a82df2e5cb2df2145f5062 /src/core/entity.h
parentdb287e4a5133125bb6f25ba21ea97c47b19ac67f (diff)
example module
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h21
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;
};