1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Bugfixes for AI, Callback Interface, logging macrodefs.

This commit is contained in:
Michał W. Urbańczyk
2007-12-06 18:32:06 +00:00
parent e1b2ae0df1
commit c8c0d0eaaf
11 changed files with 123 additions and 21 deletions

View File

@@ -10,6 +10,29 @@ class CPath;
class CGObjectInstance;
struct SComponent;
typedef struct lua_State lua_State;
class ICallback
{
public:
virtual bool moveHero(int ID, CPath * path, int idtype, int pathType=0)=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
//get info
virtual bool verifyPath(CPath * path, bool blockSea)=0;
virtual int getDate(int mode=0)=0; //mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month
virtual PseudoV< PseudoV< PseudoV<unsigned char> > > & getVisibilityMap()=0; //returns visibility map (TODO: make it const)
virtual const CGHeroInstance * getHeroInfo(int player, int val, bool mode)=0; //mode = 0 -> val = serial; mode = 1 -> val = ID
virtual int getResourceAmount(int type)=0;
virtual int howManyHeroes()=0;
virtual const CGTownInstance * getTownInfo(int val, bool mode)=0; //mode = 0 -> val = serial; mode = 1 -> val = ID
virtual int howManyTowns()=0;
virtual std::vector < std::string > getObjDescriptions(int3 pos)=0; //returns descriptions of objects at pos in order from the lowest to the highest
virtual std::vector < const CGHeroInstance *> * getHeroesInfo(bool onlyOur=true)=0;
virtual bool isVisible(int3 pos)=0;
virtual int getMyColor()=0;
virtual int getMySerial()=0;
};
struct HeroMoveDetails
{
int3 src, dst; //source and destination points
@@ -18,7 +41,7 @@ struct HeroMoveDetails
bool successful;
};
class CCallback
class CCallback : public ICallback
{
private:
void newTurn();