CEmptyAI.cpp 619 B

123456789101112131415161718192021222324252627
  1. #include "CEmptyAI.h"
  2. #include <iostream>
  3. void CEmptyAI::init(ICallback * CB)
  4. {
  5. cb = CB;
  6. human=false;
  7. playerID=cb->getMyColor();
  8. serialID=cb->getMySerial();
  9. std::cout << "EmptyAI initialized." << std::endl;
  10. }
  11. void CEmptyAI::yourTurn()
  12. {
  13. cb->endTurn();
  14. }
  15. void CEmptyAI::heroKilled(const CGHeroInstance *)
  16. {
  17. }
  18. void CEmptyAI::heroCreated(const CGHeroInstance *)
  19. {
  20. }
  21. void CEmptyAI::heroMoved(const HeroMoveDetails &)
  22. {
  23. }
  24. void CEmptyAI::heroGotLevel(const CGHeroInstance *hero, int pskill, std::vector<ui16> &skills, boost::function<void(ui32)> &callback)
  25. {
  26. callback(rand()%skills.size());
  27. }