CGameInterface.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 heroVisitsTown(const CGHeroInstance* hero, const CGTownInstance * town){};
  23. virtual void tileRevealed(int3 pos){};
  24. virtual void tileHidden(int3 pos){};
  25. virtual void receivedResource(int type, int val){};
  26. virtual void showSelDialog(std::string text, std::vector<CSelectableComponent*> & components, int askID)=0{};
  27. virtual void garrisonChanged(const CGObjectInstance * obj){};
  28. };
  29. class CAIHandler
  30. {
  31. public:
  32. static CGlobalAI * getNewAI(CCallback * cb, std::string dllname);
  33. };
  34. class CGlobalAI : public CGameInterface // AI class (to derivate)
  35. {
  36. public:
  37. //CGlobalAI();
  38. virtual void yourTurn(){};
  39. virtual void heroKilled(const CGHeroInstance*){};
  40. virtual void heroCreated(const CGHeroInstance*){};
  41. };
  42. #endif //CGAMEINTERFACE_H