From 703822461023cf09b2e0efa4a1e7a60f47afe602 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 7 Nov 2013 13:39:49 +0000 Subject: Load reputation from factions.ini. --- src/game/base/faction.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/game/base/faction.h') diff --git a/src/game/base/faction.h b/src/game/base/faction.h index 3775043..6f995dc 100644 --- a/src/game/base/faction.h +++ b/src/game/base/faction.h @@ -10,7 +10,9 @@ #include #include "math/color.h" +#include "core/entity.h" #include "core/info.h" +#include "core/reputation.h" namespace game { @@ -34,6 +36,24 @@ public: return faction_lawfull; } + /** + * @brief faction reputation + * */ + inline core::Reputation & reputation() { + return faction_reputation; + } + + /** + * @brief player reputation with a specific faction + * */ + inline const float reputation(const Info *faction) const { + if (faction == this) { + return 100.0f; + } else { + return faction_reputation.reputation(faction); + } + } + /* --- actors ----------------------------------------------------- */ /** @@ -80,9 +100,13 @@ private: bool faction_lawfull; + core::Reputation faction_reputation; + /* --- static ----------------------------------------------------- */ static core::InfoType *faction_infotype; + + static Faction *faction_default; }; } // namespace game -- cgit v1.2.3