CGameInterface.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef CGAMEINTERFACE_H
  2. #define CGAMEINTERFACE_H
  3. #include "global.h"
  4. #include "CCallback.h"
  5. BOOST_TRIBOOL_THIRD_STATE(outOfRange)
  6. using namespace boost::logic;
  7. class CCallback;
  8. class CGlobalAI;
  9. class CGHeroInstance;
  10. class CSelectableComponent;
  11. class CGameInterface
  12. {
  13. public:
  14. bool human;
  15. int playerID, serialID;
  16. virtual void init(ICallback * CB)=0{};
  17. virtual void yourTurn()=0{};
  18. virtual void heroKilled(const CGHeroInstance*)=0{};
  19. virtual void heroCreated(const CGHeroInstance*)=0{};
  20. virtual void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val)=0{};
  21. virtual void heroMoved(const HeroMoveDetails & details)=0{};
  22. virtual void tileRevealed(int3 pos)=0{};
  23. virtual void tileHidden(int3 pos)=0{};
  24. virtual void receivedResource(int type, int val){};
  25. virtual void showSelDialog(std::string text, std::vector<CSelectableComponent*> & components, int askID)=0{};
  26. };
  27. class CAIHandler
  28. {
  29. public:
  30. static CGlobalAI * getNewAI(CCallback * cb, std::string dllname);
  31. };
  32. class CGlobalAI : public CGameInterface // AI class (to derivate)
  33. {
  34. public:
  35. //CGlobalAI();
  36. virtual void yourTurn(){};
  37. virtual void heroKilled(const CGHeroInstance*){};
  38. virtual void heroCreated(const CGHeroInstance*){};
  39. };
  40. #endif //CGAMEINTERFACE_H