SideInBattle.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 & hero & armyObject;
  27. h & castSpellsCount & usedSpellsHistory & enchanterCounter;
  28. }
  29. };