CCallback.h 1.6 KB

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