virtualstd::vector<CObstacleInstance>battleGetAllObstacles()=0;//returns all obstacles on the battlefield
virtualconstCStack*battleGetStackByID(intID,boolonlyAlive=true)=0;//returns stack info by given ID
virtualconstCStack*battleGetStackByPos(intpos,boolonlyAlive=true)=0;//returns stack info by given pos
virtualintbattleGetPos(intstack)=0;//returns position (tile ID) of stack
virtualintbattleMakeAction(BattleAction*action)=0;//for casting spells by hero - DO NOT use it for moving active stack
virtualstd::vector<constCStack*>battleGetStacks()=0;//returns stacks on battlefield
virtualvoidgetStackQueue(std::vector<constCStack*>&out,inthowMany)=0;//returns vector of stack in order of their move sequence
virtualstd::vector<int>battleGetAvailableHexes(intID,booladdOccupiable)=0;//returns numbers of hexes reachable by creature with id ID
virtualboolbattleCanShoot(intID,intdest)=0;//returns true if unit with id ID can shoot to dest
virtualboolbattleCanCastSpell()=0;//returns true, if caller can cast a spell
virtualboolbattleCanFlee()=0;//returns true if caller can flee from the battle
virtualconstCGTownInstance*battleGetDefendedTown()=0;//returns defended town if current battle is a siege, NULL instead
virtualui8battleGetWallState(intpartOfWall)=0;//for determining state of a part of the wall; format: parameter [0] - keep, [1] - bottom tower, [2] - bottom wall, [3] - below gate, [4] - over gate, [5] - upper wall, [6] - uppert tower, [7] - gate; returned value: 1 - intact, 2 - damaged, 3 - destroyed; 0 - no battle
virtualintbattleGetWallUnderHex(inthex)=0;//returns part of destructible wall / gate / keep under given hex or -1 if not found
virtualstd::pair<ui32,ui32>battleEstimateDamage(intattackerID,intdefenderID)=0;//estimates damage dealt by attacker to defender; it may be not precise especially when stack has randomly working bonuses; returns pair <min dmg, max dmg>
virtualui8battleGetSiegeLevel()=0;//returns 0 when there is no siege, 1 if fort, 2 is citadel, 3 is castle
virtualconstCGHeroInstance*battleGetFightingHero(ui8side)const=0;//returns hero corresponding to given side (0 - attacker, 1 - defender)
virtualsi8battleHasDistancePenalty(intstackID,intdestHex)=0;//checks if given stack has distance penalty
virtualsi8battleHasWallPenalty(intstackID,intdestHex)=0;//checks if given stack has wall penalty
virtualvoidtrade(constCGObjectInstance*market,intmode,intid1,intid2,intval1,constCGHeroInstance*hero=NULL)=0;//mode==0: sell val1 units of id1 resource for id2 resiurce
virtualintswapCreatures(constCArmedInstance*s1,constCArmedInstance*s2,intp1,intp2)=0;//swaps creatures between two posiibly different garrisons // TODO: AI-unsafe code - fix it!
virtualintmergeStacks(constCArmedInstance*s1,constCArmedInstance*s2,intp1,intp2)=0;//joins first stack tothe second (creatures must be same type)
virtualintsplitStack(constCArmedInstance*s1,constCArmedInstance*s2,intp1,intp2,intval)=0;//split creatures from the first stack
virtualboolswapArtifacts(constCGHeroInstance*hero1,ui16pos1,constCGHeroInstance*hero2,ui16pos2)=0;//swaps artifacts between two given heroes
virtualvoidbuyArtifact(constCGHeroInstance*hero,intaid)=0;//used to buy artifacts in towns (including spell book in the guild and war machines in blacksmith)
virtualintgetSpellCost(constCSpell*sp,constCGHeroInstance*caster)const=0;//when called during battle, takes into account creatures' spell cost reduction
std::vector<CObstacleInstance>battleGetAllObstacles();//returns all obstacles on the battlefield
constCStack*battleGetStackByID(intID,boolonlyAlive=true);//returns stack info by given ID
constCStack*battleGetStackByPos(intpos,boolonlyAlive=true);//returns stack info by given pos
intbattleGetPos(intstack);//returns position (tile ID) of stack
intbattleMakeAction(BattleAction*action);//for casting spells by hero - DO NOT use it for moving active stack
std::vector<constCStack*>battleGetStacks();//returns stacks on battlefield
voidgetStackQueue(std::vector<constCStack*>&out,inthowMany);//returns vector of stack in order of their move sequence
std::vector<int>battleGetAvailableHexes(intID,booladdOccupiable);//reutrns numbers of hexes reachable by creature with id ID
boolbattleCanShoot(intID,intdest);//returns true if unit with id ID can shoot to dest
boolbattleCanCastSpell();//returns true, if caller can cast a spell
boolbattleCanFlee();//returns true if caller can flee from the battle
constCGTownInstance*battleGetDefendedTown();//returns defended town if current battle is a siege, NULL instead
ui8battleGetWallState(intpartOfWall);//for determining state of a part of the wall; format: parameter [0] - keep, [1] - bottom tower, [2] - bottom wall, [3] - below gate, [4] - over gate, [5] - upper wall, [6] - uppert tower, [7] - gate; returned value: 1 - intact, 2 - damaged, 3 - destroyed; 0 - no battle
intbattleGetWallUnderHex(inthex);//returns part of destructible wall / gate / keep under given hex or -1 if not found
std::pair<ui32,ui32>battleEstimateDamage(intattackerID,intdefenderID);//estimates damage dealt by attacker to defender; it may be not precise especially when stack has randomly working bonuses; returns pair <min dmg, max dmg>
ui8battleGetSiegeLevel();//returns 0 when there is no siege, 1 if fort, 2 is citadel, 3 is castle
constCGHeroInstance*battleGetFightingHero(ui8side)const;//returns hero corresponding ot given side (0 - attacker, 1 - defender)
si8battleHasDistancePenalty(intstackID,intdestHex);//checks if given stack has distance penalty
si8battleHasWallPenalty(intstackID,intdestHex);//checks if given stack has wall penalty
si8battleCanTeleportTo(intstackID,intdestHex,inttelportLevel);//checks if teleportation of given stack to given position can take place
intgetDate(intmode=0)const;//mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month
std::vector<std::vector<std::vector<unsignedchar>>>&getVisibilityMap()const;//returns visibility map (TODO: make it const)
constCGHeroInstance*getHeroInfo(intval,intmode=2)const;//mode = 0 -> val = serial; mode = 1 -> val = hero type id (subID); mode = 2 -> val = global object serial id (id)
voidcalculatePaths(constCGHeroInstance*hero,CPathsInfo&out,int3src=int3(-1,-1,-1),intmovement=-1);//calculates possible paths for hero, by default uses current hero position and movement left;
voidrecalculatePaths();//updates pathfinder info (should be called when moving hero is over)