summaryrefslogtreecommitdiffstats
path: root/source/MobFamilyCollecter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/MobFamilyCollecter.cpp')
-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();
}
+
+
+
+