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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user