2011-12-14 00:23:17 +03:00
|
|
|
#include "StdInc.h"
|
2007-10-17 01:41:45 +03:00
|
|
|
#include "CEmptyAI.h"
|
2011-12-14 00:23:17 +03:00
|
|
|
|
2011-05-04 05:32:35 +03:00
|
|
|
void CEmptyAI::init(CCallback * CB)
|
2007-10-21 19:45:13 +03:00
|
|
|
{
|
|
|
|
cb = CB;
|
|
|
|
human=false;
|
2007-12-01 14:50:33 +02:00
|
|
|
playerID=cb->getMyColor();
|
2007-10-21 19:45:13 +03:00
|
|
|
std::cout << "EmptyAI initialized." << std::endl;
|
|
|
|
}
|
2007-10-17 01:41:45 +03:00
|
|
|
void CEmptyAI::yourTurn()
|
|
|
|
{
|
2008-07-27 20:07:37 +03:00
|
|
|
cb->endTurn();
|
2007-10-17 01:41:45 +03:00
|
|
|
}
|
2012-07-15 18:34:00 +03:00
|
|
|
|
|
|
|
void CEmptyAI::heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, int queryID)
|
2007-10-17 01:41:45 +03:00
|
|
|
{
|
2012-07-15 18:34:00 +03:00
|
|
|
cb->selectionMade(rand() % skills.size(), queryID);
|
2007-10-17 01:41:45 +03:00
|
|
|
}
|
2012-06-01 18:59:26 +03:00
|
|
|
|
2012-07-15 18:34:00 +03:00
|
|
|
void CEmptyAI::commanderGotLevel(const CCommanderInstance * commander, std::vector<ui32> skills, int queryID)
|
2007-10-17 01:41:45 +03:00
|
|
|
{
|
2012-07-15 18:34:00 +03:00
|
|
|
cb->selectionMade(rand() % skills.size(), queryID);
|
2007-10-17 01:41:45 +03:00
|
|
|
}
|
2012-06-01 18:59:26 +03:00
|
|
|
|
|
|
|
void CEmptyAI::showBlockingDialog(const std::string &text, const std::vector<Component> &components, ui32 askID, const int soundID, bool selection, bool cancel)
|
2007-10-17 01:41:45 +03:00
|
|
|
{
|
2012-06-01 18:59:26 +03:00
|
|
|
cb->selectionMade(0, askID);
|
2008-08-13 03:44:31 +03:00
|
|
|
}
|
2012-06-01 18:59:26 +03:00
|
|
|
|
2012-07-15 18:34:00 +03:00
|
|
|
void CEmptyAI::showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, int queryID)
|
2008-08-13 03:44:31 +03:00
|
|
|
{
|
2012-07-15 18:34:00 +03:00
|
|
|
cb->selectionMade(0, queryID);
|
2012-06-01 18:59:26 +03:00
|
|
|
}
|