2017-06-24 15:51:07 +02:00
|
|
|
/*
|
|
|
|
* CCallbackBase.cpp, 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
|
|
|
|
*
|
|
|
|
*/
|
2017-07-01 20:05:10 +02:00
|
|
|
#include "StdInc.h"
|
2017-06-24 15:51:07 +02:00
|
|
|
#include "CCallbackBase.h"
|
|
|
|
#include "BattleInfo.h"
|
2017-06-29 01:02:05 +02:00
|
|
|
#include "../CGameState.h"
|
2017-06-24 15:51:07 +02:00
|
|
|
|
|
|
|
bool CCallbackBase::duringBattle() const
|
|
|
|
{
|
|
|
|
return getBattle() != nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const BattleInfo *CCallbackBase::getBattle() const
|
|
|
|
{
|
|
|
|
return battle;
|
|
|
|
}
|
|
|
|
|
|
|
|
CCallbackBase::CCallbackBase(CGameState * GS, boost::optional<PlayerColor> Player)
|
|
|
|
: battle(nullptr), gs(GS), player(Player)
|
|
|
|
{}
|
|
|
|
|
|
|
|
CCallbackBase::CCallbackBase()
|
|
|
|
: battle(nullptr), gs(nullptr)
|
|
|
|
{}
|
|
|
|
|
2017-06-26 18:50:35 +02:00
|
|
|
void CCallbackBase::setBattle(const BattleInfo * B)
|
2017-06-24 15:51:07 +02:00
|
|
|
{
|
|
|
|
battle = B;
|
|
|
|
}
|
|
|
|
|
|
|
|
boost::optional<PlayerColor> CCallbackBase::getPlayerID() const
|
|
|
|
{
|
|
|
|
return player;
|
|
|
|
}
|
|
|
|
|