summaryrefslogtreecommitdiffstats
path: root/source/MobFamilyCollecter.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-10-18 12:41:43 +0200
committerMattes D <github@xoft.cz>2013-10-18 12:41:43 +0200
commit8bba2b02a132d236703835d93ab18e09e0ea7230 (patch)
treee637945c6eb845e82c4f2790c07c6fd82a1f79ef /source/MobFamilyCollecter.cpp
parentAPIDump: Renamed output for helper stuff. (diff)
parentRemoved reading default values from settings.ini for worlds. (diff)
downloadcuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.tar
cuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.tar.gz
cuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.tar.bz2
cuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.tar.lz
cuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.tar.xz
cuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.tar.zst
cuberite-8bba2b02a132d236703835d93ab18e09e0ea7230.zip
Diffstat (limited to 'source/MobFamilyCollecter.cpp')
-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();
+}