CCallback.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef CCALLBACK_H
  2. #define CCALLBACK_H
  3. class CGameState;
  4. class CHeroInstance;
  5. class CTownInstance;
  6. class CPath;
  7. class CObjectInstance;
  8. struct HeroMoveDetails
  9. {
  10. int3 src, dst; //source and destination points
  11. CObjectInstance * ho; //object instance of this hero
  12. int owner;
  13. };
  14. class CCallback
  15. {
  16. private:
  17. void newTurn();
  18. CCallback(CGameState * GS, int Player):gs(GS),player(Player){};
  19. CGameState * gs;
  20. int lowestSpeed(CHeroInstance * chi); //speed of the slowest stack
  21. int valMovePoints(CHeroInstance * chi);
  22. protected:
  23. int player;
  24. public:
  25. bool moveHero(int ID, CPath * path, int idtype, int pathType=0);//idtype: 0 - position in vector of heroes (of that player); 1 - ID of hero
  26. //pathType: 0 - nodes are manifestation pos, 1 - nodes are object pos
  27. std::vector < std::string > getObjDescriptions(int3 pos); //returns descriptions of objects at pos in order from the lowest to the highest
  28. int howManyTowns();
  29. const CTownInstance * getTownInfo(int val, bool mode); //mode = 0 -> val = serial; mode = 1 -> val = ID
  30. int howManyHeroes(int player);
  31. const CHeroInstance * getHeroInfo(int player, int val, bool mode); //mode = 0 -> val = serial; mode = 1 -> val = ID
  32. int getResourceAmount(int type);
  33. int getDate(int mode=0); //mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month
  34. bool verifyPath(CPath * path, bool blockSea);
  35. friend int _tmain(int argc, _TCHAR* argv[]);
  36. };
  37. #endif //CCALLBACK_H