RaceTypes.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "RaceTypes.h"
  17. MasterRaceTypeList::MasterRaceTypeList() {
  18. }
  19. MasterRaceTypeList::~MasterRaceTypeList() {
  20. }
  21. void MasterRaceTypeList::AddRaceType(int16 model_id, int16 raceType_id) {
  22. if (m_raceList.count(model_id) == 0)
  23. m_raceList[model_id] = raceType_id;
  24. }
  25. int16 MasterRaceTypeList::GetRaceType(int16 model_id) {
  26. int16 ret = 0;
  27. if (m_raceList.count(model_id) > 0)
  28. ret = m_raceList[model_id];
  29. return ret;
  30. }
  31. int16 MasterRaceTypeList::GetRaceBaseType(int16 model_id) {
  32. int16 ret = 0;
  33. if (m_raceList.count(model_id) == 0)
  34. return ret;
  35. int16 race = m_raceList[model_id];
  36. if (race >= DRAGONKIND && race < FAY)
  37. ret = DRAGONKIND;
  38. else if (race >= FAY && race < MAGICAL)
  39. ret = FAY;
  40. else if (race >= MAGICAL && race < MECHANIMAGICAL)
  41. ret = MAGICAL;
  42. else if (race >= MECHANIMAGICAL && race < NATURAL)
  43. ret = MECHANIMAGICAL;
  44. else if (race >= NATURAL && race < PLANAR)
  45. ret = NATURAL;
  46. else if (race >= PLANAR && race < PLANT)
  47. ret = PLANAR;
  48. else if (race >= PLANT && race < SENTIENT)
  49. ret = PLANT;
  50. else if (race >= SENTIENT && race < UNDEAD)
  51. ret = SENTIENT;
  52. else if (race >= UNDEAD && race < WERE)
  53. ret = UNDEAD;
  54. else if (race >= WERE)
  55. ret = WERE;
  56. return ret;
  57. }