2014-06-23 20:58:19 +03:00
|
|
|
#pragma once
|
2014-06-05 19:52:14 +03:00
|
|
|
|
|
|
|
#include "CObjectHandler.h"
|
|
|
|
#include "../CCreatureSet.h"
|
|
|
|
|
|
|
|
/*
|
2014-06-05 20:26:50 +03:00
|
|
|
* CArmedInstance.h, part of VCMI engine
|
2014-06-05 19:52:14 +03:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-08-11 21:17:17 +03:00
|
|
|
struct BattleInfo;
|
2014-06-25 17:11:07 +03:00
|
|
|
class CGameState;
|
|
|
|
|
2014-06-05 19:52:14 +03:00
|
|
|
class DLL_LINKAGE CArmedInstance: public CGObjectInstance, public CBonusSystemNode, public CCreatureSet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BattleInfo *battle; //set to the current battle, if engaged
|
|
|
|
|
|
|
|
void randomizeArmy(int type);
|
|
|
|
virtual void updateMoraleBonusFromArmy();
|
|
|
|
|
|
|
|
void armyChanged() override;
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// int valOfGlobalBonuses(CSelector selector) const; //used only for castle interface ???
|
|
|
|
virtual CBonusSystemNode *whereShouldBeAttached(CGameState *gs);
|
|
|
|
virtual CBonusSystemNode *whatShouldBeAttached();
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
CArmedInstance();
|
|
|
|
|
|
|
|
template <typename Handler> void serialize(Handler &h, const int version)
|
|
|
|
{
|
|
|
|
h & static_cast<CGObjectInstance&>(*this);
|
|
|
|
h & static_cast<CBonusSystemNode&>(*this);
|
|
|
|
h & static_cast<CCreatureSet&>(*this);
|
|
|
|
}
|
|
|
|
};
|