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
|
|
|
|
2013-06-22 17:47:20 +03:00
|
|
|
void CEmptyAI::init(shared_ptr<CCallback> CB)
|
2007-10-21 19:45:13 +03:00
|
|
|
{
|
|
|
|
cb = CB;
|
|
|
|
human=false;
|
2013-02-11 20:23:55 +03:00
|
|
|
playerID = *cb->getMyColor();
|
2013-04-11 18:58:01 +03:00
|
|
|
logAi->infoStream() << "EmptyAI initialized.";
|
2007-10-21 19:45:13 +03:00
|
|
|
}
|
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
|
|
|
|
2013-05-27 17:20:46 +03:00
|
|
|
void CEmptyAI::heroGotLevel(const CGHeroInstance *hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> &skills, QueryID 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
|
|
|
|
2013-05-27 17:20:46 +03:00
|
|
|
void CEmptyAI::commanderGotLevel(const CCommanderInstance * commander, std::vector<ui32> skills, QueryID 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
|
|
|
|
2013-05-27 17:20:46 +03:00
|
|
|
void CEmptyAI::showBlockingDialog(const std::string &text, const std::vector<Component> &components, QueryID 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
|
|
|
|
2013-05-27 17:20:46 +03:00
|
|
|
void CEmptyAI::showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, QueryID queryID)
|
2008-08-13 03:44:31 +03:00
|
|
|
{
|
2012-07-15 18:34:00 +03:00
|
|
|
cb->selectionMade(0, queryID);
|
2013-04-11 18:58:01 +03:00
|
|
|
}
|