summaryrefslogtreecommitdiffstats
path: root/source/MobFamilyCollecter.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-18 20:02:53 +0200
committermadmaxoft <github@xoft.cz>2013-10-18 20:02:53 +0200
commitca538d5323bbd8b33d87ad8ee8954529e0cf7c61 (patch)
treece53e154ea9fe4889f6b8593811a718574507d23 /source/MobFamilyCollecter.cpp
parentStringToItem() recognizes "ItemName:Dmg" strings. (diff)
downloadcuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.gz
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.bz2
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.lz
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.xz
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.zst
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.zip
Diffstat (limited to '')
-rw-r--r--source/MobFamilyCollecter.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/source/MobFamilyCollecter.cpp b/source/MobFamilyCollecter.cpp
index 2aa46599a..086fa5f40 100644
--- a/source/MobFamilyCollecter.cpp
+++ b/source/MobFamilyCollecter.cpp
@@ -6,7 +6,7 @@
-cMobFamilyCollecter::tMobFamilyList cMobFamilyCollecter::initMobFamilyBeforeCx11()
+cMobFamilyCollecter::tMobFamilyList cMobFamilyCollecter::InitMobFamilyBeforeCx11(void)
{
std::set<cMonster::eFamily> toReturn;
toReturn.insert(cMonster::mfHostile);
@@ -15,19 +15,37 @@ cMobFamilyCollecter::tMobFamilyList cMobFamilyCollecter::initMobFamilyBeforeCx11
toReturn.insert(cMonster::mfWater);
return toReturn;
}
-cMobFamilyCollecter::tMobFamilyList& cMobFamilyCollecter::m_AllFamilies()
+
+
+
+
+
+cMobFamilyCollecter::tMobFamilyList & cMobFamilyCollecter::m_AllFamilies(void)
{
- static tMobFamilyList* AllFamilies = new tMobFamilyList(initMobFamilyBeforeCx11());
+ // TODO: This memory is leaked:
+ 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)
+
+
+
+
+int cMobFamilyCollecter::GetNumberOfCollectedMobs(cMonster::eFamily a_Family)
{
return m_Mobs[a_Family].size();
}
+
+
+
+