CGameInterface.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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(CCallback * 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 receivedResource(int type, int val){};
  22. };
  23. class CAIHandler
  24. {
  25. public:
  26. static CGlobalAI * getNewAI(CCallback * cb, std::string dllname);
  27. };
  28. class CGlobalAI : public CGameInterface // AI class (to derivate)
  29. {
  30. public:
  31. //CGlobalAI();
  32. virtual void yourTurn(){};
  33. virtual void heroKilled(const CGHeroInstance*){};
  34. virtual void heroCreated(const CGHeroInstance*){};
  35. };
  36. #endif //CGAMEINTERFACE_H