2008-12-27 03:01:59 +02:00
|
|
|
#define VCMI_DLL
|
|
|
|
#include "IGameCallback.h"
|
|
|
|
#include "../CGameState.h"
|
|
|
|
#include "../map.h"
|
|
|
|
#include "../hch/CObjectHandler.h"
|
2009-02-08 08:42:15 +02:00
|
|
|
#include "../StartInfo.h"
|
2008-12-27 03:01:59 +02:00
|
|
|
|
|
|
|
const CGObjectInstance* IGameCallback::getObj(int objid)
|
|
|
|
{
|
|
|
|
return gs->map->objects[objid];
|
|
|
|
}
|
|
|
|
const CGHeroInstance* IGameCallback::getHero(int objid)
|
|
|
|
{
|
|
|
|
return dynamic_cast<const CGHeroInstance*>(gs->map->objects[objid]);
|
|
|
|
}
|
|
|
|
const CGTownInstance* IGameCallback::getTown(int objid)
|
|
|
|
{
|
|
|
|
return dynamic_cast<const CGTownInstance*>(gs->map->objects[objid]);
|
|
|
|
}
|
|
|
|
|
|
|
|
int IGameCallback::getOwner(int heroID)
|
|
|
|
{
|
|
|
|
return gs->map->objects[heroID]->tempOwner;
|
|
|
|
}
|
|
|
|
int IGameCallback::getResource(int player, int which)
|
|
|
|
{
|
|
|
|
return gs->players.find(player)->second.resources[which];
|
|
|
|
}
|
|
|
|
int IGameCallback::getDate(int mode)
|
|
|
|
{
|
|
|
|
return gs->getDate(mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
const CGHeroInstance* IGameCallback::getSelectedHero( int player )
|
|
|
|
{
|
|
|
|
return getHero(gs->players.find(player)->second.currentSelection);
|
2009-02-08 08:42:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const PlayerSettings * IGameCallback::getPlayerSettings( int color )
|
|
|
|
{
|
|
|
|
return &gs->scenarioOps->getIthPlayersSettings(color);
|
2008-12-27 03:01:59 +02:00
|
|
|
}
|