SideInBattle.cpp 850 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * SideInBattle.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "SideInBattle.h"
  12. #include "../mapObjects/CArmedInstance.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. void SideInBattle::init(const CGHeroInstance * Hero, const CArmedInstance * Army)
  15. {
  16. hero = Hero;
  17. armyObject = Army;
  18. switch(armyObject->ID)
  19. {
  20. case Obj::CREATURE_GENERATOR1:
  21. case Obj::CREATURE_GENERATOR2:
  22. case Obj::CREATURE_GENERATOR3:
  23. case Obj::CREATURE_GENERATOR4:
  24. color = PlayerColor::NEUTRAL;
  25. break;
  26. default:
  27. color = armyObject->getOwner();
  28. }
  29. if(color == PlayerColor::UNFLAGGABLE)
  30. color = PlayerColor::NEUTRAL;
  31. }
  32. VCMI_LIB_NAMESPACE_END