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

Game interfaces can register another interfaces to receive info on game events.

This commit is contained in:
Michał W. Urbańczyk
2013-06-22 18:22:44 +00:00
parent 254f194220
commit 2be2143844
5 changed files with 39 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ struct CGPathNode;
struct CGPath;
struct CPathsInfo;
struct CPack;
class CBattleGameInterface;
class CGameInterface;
class IBattleCallback
{
@@ -111,6 +113,11 @@ public:
virtual void calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int3 src = int3(-1,-1,-1), int movement = -1);
virtual void recalculatePaths(); //updates main, client pathfinder info (should be called when moving hero is over)
//Set of metrhods that allows adding more interfaces for this player that'll receive game event call-ins.
void registerGameInterface(CGameInterface *cgi);
void registerBattleInterface(CBattleGameInterface *cbga);
void unregisterGameInterface(CGameInterface *cgi);
void unregisterBattleInterface(CBattleGameInterface *cbga);
void unregisterMyInterface(); //stops delivering information about game events to that player's interface -> can be called ONLY after victory/loss