CGameInterface.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 CGameInterface
  11. {
  12. public:
  13. bool human;
  14. int playerID, serialID;
  15. virtual void init(ICallback * CB)=0{};
  16. virtual void yourTurn()=0{};
  17. virtual void heroKilled(const CGHeroInstance*)=0{};
  18. virtual void heroCreated(const CGHeroInstance*)=0{};
  19. virtual void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val)=0{};
  20. virtual void heroMoved(const HeroMoveDetails & details)=0{};
  21. virtual void tileRevealed(int3 pos)=0{};
  22. virtual void tileHidden(int3 pos)=0{};
  23. virtual void receivedResource(int type, int val){};
  24. };
  25. class CAIHandler
  26. {
  27. public:
  28. static CGlobalAI * getNewAI(CCallback * cb, std::string dllname);
  29. };
  30. class CGlobalAI : public CGameInterface // AI class (to derivate)
  31. {
  32. public:
  33. //CGlobalAI();
  34. virtual void yourTurn(){};
  35. virtual void heroKilled(const CGHeroInstance*){};
  36. virtual void heroCreated(const CGHeroInstance*){};
  37. };
  38. #endif //CGAMEINTERFACE_H