SideInBattle.cpp 788 B

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