SideInBattle.cpp 734 B

12345678910111213141516171819202122232425262728293031
  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. SideInBattle::SideInBattle()
  14. {
  15. color = PlayerColor::CANNOT_DETERMINE;
  16. hero = nullptr;
  17. armyObject = nullptr;
  18. castSpellsCount = 0;
  19. enchanterCounter = 0;
  20. }
  21. void SideInBattle::init(const CGHeroInstance * Hero, const CArmedInstance * Army)
  22. {
  23. hero = Hero;
  24. armyObject = Army;
  25. color = armyObject->getOwner();
  26. if(color == PlayerColor::UNFLAGGABLE)
  27. color = PlayerColor::NEUTRAL;
  28. }