Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-21 19:33:57 +0000
committerStijn Buys <ingar@osirion.org>2008-08-21 19:33:57 +0000
commit7668b60981dadeced3b5c8ee27c16575d59844de (patch)
treef543058621bc46b67c13d7129dac62b11ee7df38 /src/core
parentfa589fafa7f094bc1bf07642b55f3d824814adba (diff)
entity.set_eventstate
Diffstat (limited to 'src/core')
-rw-r--r--src/core/entity.cc8
-rw-r--r--src/core/entity.h5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 7472908..04ede71 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -279,6 +279,14 @@ EntityDynamic::~EntityDynamic()
{
}
+void EntityDynamic::set_eventstate(Event eventstate)
+{
+ if (entity_eventstate != eventstate) {
+ entity_eventstate = eventstate;
+ entity_dirty = true;
+ }
+}
+
void EntityDynamic::frame(float seconds)
{
if ((flags() & Static) == Static)
diff --git a/src/core/entity.h b/src/core/entity.h
index 30e3356..8a996fd 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -266,6 +266,9 @@ public:
/// receive a server-to-client update from a stream
virtual void receive_server_update(std::istream &is);
+ /// set event state
+ virtual void set_eventstate(Event eventstate);
+
/// runs one game frame for the entity
/**
* The default implementation will update the position() of the entity,
@@ -276,10 +279,10 @@ public:
/// speed of the entity
float entity_speed;
- unsigned int entity_eventstate;
protected:
float entity_timer;
+ int entity_eventstate;
};