diff options
author | mgueydan <gueydan.mathieuÃ@gmail.com> | 2013-09-08 01:21:43 +0200 |
---|---|---|
committer | mgueydan <gueydan.mathieuÃ@gmail.com> | 2013-09-08 01:21:43 +0200 |
commit | caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c (patch) | |
tree | da48273cd36e3095cefe782ae1e274dbe6745258 /source/MobTypesManager.h | |
parent | Adding an Empty shell that would launch mob spawner - not called yet (diff) | |
download | cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.tar cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.tar.gz cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.tar.bz2 cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.tar.lz cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.tar.xz cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.tar.zst cuberite-caa54af54640d1c94c57bc84b6b1e4eb2e7a6f3c.zip |
Diffstat (limited to 'source/MobTypesManager.h')
-rw-r--r-- | source/MobTypesManager.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/MobTypesManager.h b/source/MobTypesManager.h index 0e628899e..a1b2dfddc 100644 --- a/source/MobTypesManager.h +++ b/source/MobTypesManager.h @@ -10,20 +10,23 @@ class cFastRandom; // functionnalities are (in the first version) : // - create a mob from its type (as enum) (in that way it is a compiler-proxy for mobs) // - can transform MobTypes from enums to string and reciprocal +// - return mob family from providen type class cMobTypesManager { public: static const std::string& fromMobTypeToString(cMonster::eType a_MobType); - static cMonster::eType fromStringToMobType(const std::string&); - -public: - class NotAMonsterException : public std::exception {}; //MG TODO : check if this is this project way to do it + static cMonster::eType fromStringToMobType(const std::string& a_MobTypeName); + static cMonster::eFamily getFamilyFromType(cMonster::eType a_MobType); protected : typedef const std::map<cMonster::eType,std::string> tMobTypes2Names; static tMobTypes2Names& m_MobsTypes2Names(); static tMobTypes2Names MobTypes2NamesInitializerBeforeCx11(); + typedef const std::map<cMonster::eType,cMonster::eFamily> tMobType2Family; //MG TODO : this is redundancy with cMonster::getFamily() methods. But almost all the management of MobType is redundancy in this project. Maybe is it optimization, or just historical TODO : understand and do something about it. + static tMobType2Family& m_MobsType2Family(); + static tMobType2Family MobType2FamilyInitializerBeforeCx11(); + static cFastRandom& m_Random(); public : |