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