summaryrefslogtreecommitdiffstats
path: root/source/MobFamilyCollecter.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/MobFamilyCollecter.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/source/MobFamilyCollecter.cpp b/source/MobFamilyCollecter.cpp
new file mode 100644
index 000000000..2aa46599a
--- /dev/null
+++ b/source/MobFamilyCollecter.cpp
@@ -0,0 +1,33 @@
+
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "MobFamilyCollecter.h"
+#include "Mobs/Monster.h"
+
+
+
+cMobFamilyCollecter::tMobFamilyList cMobFamilyCollecter::initMobFamilyBeforeCx11()
+{
+ std::set<cMonster::eFamily> toReturn;
+ toReturn.insert(cMonster::mfHostile);
+ toReturn.insert(cMonster::mfPassive);
+ toReturn.insert(cMonster::mfAmbient);
+ toReturn.insert(cMonster::mfWater);
+ return toReturn;
+}
+cMobFamilyCollecter::tMobFamilyList& cMobFamilyCollecter::m_AllFamilies()
+{
+ static tMobFamilyList* AllFamilies = new tMobFamilyList(initMobFamilyBeforeCx11());
+ return *AllFamilies;
+}
+
+void cMobFamilyCollecter::CollectMob(cMonster& a_Monster)
+{
+ cMonster::eFamily MobFamily = a_Monster.GetMobFamily();
+ m_Mobs[MobFamily].insert(&a_Monster);
+}
+
+int cMobFamilyCollecter::getNumberOfCollectedMobs(cMonster::eFamily a_Family)
+{
+ return m_Mobs[a_Family].size();
+}