CGameInterface.h 1006 B

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