2011-12-13 21:23:17 +00:00
|
|
|
#include "StdInc.h"
|
2007-10-16 22:41:45 +00:00
|
|
|
#include "CEmptyAI.h"
|
2011-12-13 21:23:17 +00:00
|
|
|
|
2013-06-22 14:47:20 +00:00
|
|
|
void CEmptyAI::init(shared_ptr<CCallback> CB)
|
2007-10-21 16:45:13 +00:00
|
|
|
{
|
|
|
|
cb = CB;
|
|
|
|
human=false;
|
2013-02-11 17:23:55 +00:00
|
|
|
playerID = *cb->getMyColor();
|
2013-07-25 11:53:36 +00:00
|
|
|
//logAi->infoStream() << "EmptyAI initialized.";
|
2007-10-21 16:45:13 +00:00
|
|
|
}
|
2007-10-16 22:41:45 +00:00
|
|
|
void CEmptyAI::yourTurn()
|
|
|
|
{
|
2008-07-27 17:07:37 +00:00
|
|
|
cb->endTurn();
|
2007-10-16 22:41:45 +00:00
|
|
|
}
|
2012-07-15 15:34:00 +00:00
|
|
|
|
2013-05-27 14:20:46 +00:00
|
|
|
void CEmptyAI::heroGotLevel(const CGHeroInstance *hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> &skills, QueryID queryID)
|
2007-10-16 22:41:45 +00:00
|
|
|
{
|
2012-07-15 15:34:00 +00:00
|
|
|
cb->selectionMade(rand() % skills.size(), queryID);
|
2007-10-16 22:41:45 +00:00
|
|
|
}
|
2012-06-01 15:59:26 +00:00
|
|
|
|
2013-05-27 14:20:46 +00:00
|
|
|
void CEmptyAI::commanderGotLevel(const CCommanderInstance * commander, std::vector<ui32> skills, QueryID queryID)
|
2007-10-16 22:41:45 +00:00
|
|
|
{
|
2012-07-15 15:34:00 +00:00
|
|
|
cb->selectionMade(rand() % skills.size(), queryID);
|
2007-10-16 22:41:45 +00:00
|
|
|
}
|
2012-06-01 15:59:26 +00:00
|
|
|
|
2013-05-27 14:20:46 +00:00
|
|
|
void CEmptyAI::showBlockingDialog(const std::string &text, const std::vector<Component> &components, QueryID askID, const int soundID, bool selection, bool cancel)
|
2007-10-16 22:41:45 +00:00
|
|
|
{
|
2012-06-01 15:59:26 +00:00
|
|
|
cb->selectionMade(0, askID);
|
2008-08-13 00:44:31 +00:00
|
|
|
}
|
2012-06-01 15:59:26 +00:00
|
|
|
|
2013-05-27 14:20:46 +00:00
|
|
|
void CEmptyAI::showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, QueryID queryID)
|
2008-08-13 00:44:31 +00:00
|
|
|
{
|
2012-07-15 15:34:00 +00:00
|
|
|
cb->selectionMade(0, queryID);
|
2013-04-11 15:58:01 +00:00
|
|
|
}
|