SideInBattle.h 1.1 KB

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