SideInBattle.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * SideInBattle.h, 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. #pragma once
  11. #include "../GameConstants.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class CGHeroInstance;
  14. class CArmedInstance;
  15. struct DLL_LINKAGE SideInBattle
  16. {
  17. PlayerColor color;
  18. const CGHeroInstance * hero; //may be NULL if army is not commanded by hero
  19. const CArmedInstance * armyObject; //adv. map object with army that participates in battle; may be same as hero
  20. uint32_t castSpellsCount; //how many spells each side has been cast this turn
  21. std::vector<SpellID> usedSpellsHistory; //every time hero casts spell, it's inserted here -> eagle eye skill
  22. int32_t enchanterCounter; //tends to pass through 0, so sign is needed
  23. SideInBattle();
  24. void init(const CGHeroInstance * Hero, const CArmedInstance * Army);
  25. template <typename Handler> void serialize(Handler &h, const int version)
  26. {
  27. h & color;
  28. h & hero;
  29. h & armyObject;
  30. h & castSpellsCount;
  31. h & usedSpellsHistory;
  32. h & enchanterCounter;
  33. }
  34. };
  35. VCMI_LIB_NAMESPACE_END