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>2013-11-07 13:38:11 +0000
committerStijn Buys <ingar@osirion.org>2013-11-07 13:38:11 +0000
commit4896428eefa6e621523168a42dceda4f8f2b0097 (patch)
tree4b2d183b9d9f4054326f4fede778f05c0d2a9659 /src/core/entity.h
parent66746168f710cfdfbb0853947985fa0c552e81fb (diff)
Added core:: support for entity factions and player reputation (single-player only).
Diffstat (limited to 'src/core/entity.h')
-rw-r--r--src/core/entity.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/core/entity.h b/src/core/entity.h
index e1a952d..adeac0f 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -250,6 +250,12 @@ public:
return entity_keepalive;
}
+
+ inline const Info *faction() const
+ {
+ return entity_faction;
+ }
+
/* ---- mutators -------------------------------------------------- */
/// assign shape
@@ -384,9 +390,18 @@ public:
/**
* @brief set the timestamp when the entity was last alive
* */
- void set_keepalive(unsigned long timestamp) {
+ inline void set_keepalive(unsigned long timestamp)
+ {
entity_keepalive = timestamp;
}
+
+ /**
+ * @brief set the faction this entity belongs to.
+ * */
+ inline void set_faction(const Info *faction)
+ {
+ entity_faction = faction;
+ }
/* ---- actors ---------------------------------------------------- */
@@ -558,6 +573,8 @@ private:
unsigned long entity_keepalive;
+ const Info *entity_faction;
+
static Registry entity_registry;
static size_t entity_nextid;
@@ -821,12 +838,16 @@ public:
/// receive a server-to-client update from a stream
virtual void receive_server_update(std::istream &is);
- /// set the player who owns this entity
+ /**
+ * @brief set the player who owns this entity
+ * */
void set_owner(Player *owner);
- /// set thrust
+ /**
+ * @brief set thrust
+ * */
void set_thrust(float thrust);
-
+
protected:
/// physics action interface callback
@@ -878,7 +899,6 @@ protected:
private:
/// owner of the entity
Player *entity_owner;
-
};
} // namespace core