diff options
author | madmaxoft <github@xoft.cz> | 2013-10-18 20:02:53 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-18 20:02:53 +0200 |
commit | ca538d5323bbd8b33d87ad8ee8954529e0cf7c61 (patch) | |
tree | ce53e154ea9fe4889f6b8593811a718574507d23 /source/MobFamilyCollecter.h | |
parent | StringToItem() recognizes "ItemName:Dmg" strings. (diff) | |
download | cuberite-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 'source/MobFamilyCollecter.h')
-rw-r--r-- | source/MobFamilyCollecter.h | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/source/MobFamilyCollecter.h b/source/MobFamilyCollecter.h index 659d2b687..cd05b6adb 100644 --- a/source/MobFamilyCollecter.h +++ b/source/MobFamilyCollecter.h @@ -6,35 +6,44 @@ #include "BlockID.h" #include "Mobs/Monster.h" //this is a side-effect of keeping Mobfamily inside Monster class. I'd prefer to keep both (Mobfamily and Monster) inside a "Monster" namespace MG TODO : do it + + + +// fwd: class cChunk; -// This class is used to collect, for each Mob, what is it's family. It was first -// being designed to check the caps of the mobs (no more than ... hostile mob in the world) -// -// as side effects : it also know what is the spawnrate of each family : MG TODO relocate + + + +/** This class is used to collect, for each Mob, what is it's family. It was first +being designed to check the caps of the mobs (no more than ... hostile mob in the world) + +as side effects : it also know what is the spawnrate of each family : MG TODO relocate +*/ class cMobFamilyCollecter { -protected : - std::map<cMonster::eFamily,std::set<cMonster*> > m_Mobs; - public : + typedef const std::set<cMonster::eFamily> tMobFamilyList; + typedef const std::map<cMonster::eFamily,int> tMobSpawRate; + // collect a mob - void CollectMob(cMonster& a_Monster); + void CollectMob(cMonster & a_Monster); // return the number of mobs for this family - int getNumberOfCollectedMobs(cMonster::eFamily a_Family); + int GetNumberOfCollectedMobs(cMonster::eFamily a_Family); -public : - typedef const std::set<cMonster::eFamily> tMobFamilyList; - static tMobFamilyList& m_AllFamilies(); + static tMobFamilyList & m_AllFamilies(void); -public : - typedef const std::map<cMonster::eFamily,int> tMobSpawRate; - static tMobSpawRate& m_SpawnRate(); + static tMobSpawRate & m_SpawnRate(void); protected : - static tMobFamilyList initMobFamilyBeforeCx11(); - static tMobSpawRate initMobSpawnRateBeforeCx11(); -}; + std::map<cMonster::eFamily, std::set<cMonster*> > m_Mobs; + + static tMobFamilyList InitMobFamilyBeforeCx11(void); + static tMobSpawRate InitMobSpawnRateBeforeCx11(void); +} ; + + + |