2017-03-17 17:48:44 +02:00
|
|
|
/*
|
|
|
|
* SideInBattle.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
2017-06-29 01:02:05 +02:00
|
|
|
#include "../GameConstants.h"
|
2017-03-17 17:48:44 +02:00
|
|
|
|
|
|
|
class CGHeroInstance;
|
|
|
|
class CArmedInstance;
|
|
|
|
|
|
|
|
struct DLL_LINKAGE SideInBattle
|
|
|
|
{
|
|
|
|
PlayerColor color;
|
2017-06-29 01:02:05 +02:00
|
|
|
const CGHeroInstance * hero; //may be NULL if army is not commanded by hero
|
|
|
|
const CArmedInstance * armyObject; //adv. map object with army that participates in battle; may be same as hero
|
2017-03-17 17:48:44 +02:00
|
|
|
|
|
|
|
ui8 castSpellsCount; //how many spells each side has cast this turn
|
|
|
|
std::vector<const CSpell *> usedSpellsHistory; //every time hero casts spell, it's inserted here -> eagle eye skill
|
|
|
|
si16 enchanterCounter; //tends to pass through 0, so sign is needed
|
|
|
|
|
|
|
|
SideInBattle();
|
2017-06-29 01:02:05 +02:00
|
|
|
void init(const CGHeroInstance * Hero, const CArmedInstance * Army);
|
2017-03-17 17:48:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
template <typename Handler> void serialize(Handler &h, const int version)
|
|
|
|
{
|
2017-07-31 15:35:42 +02:00
|
|
|
h & color;
|
|
|
|
h & hero;
|
|
|
|
h & armyObject;
|
|
|
|
h & castSpellsCount;
|
|
|
|
h & usedSpellsHistory;
|
|
|
|
h & enchanterCounter;
|
2017-03-17 17:48:44 +02:00
|
|
|
}
|
|
|
|
};
|