1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00
vcmi/lib/ERMScriptModule.h
Michał W. Urbańczyk 617e1f962e New files for lib:
* lib/ERMScriptModule.cpp
* lib/ERMScriptModule.h
* lib/CObstacleInstance.h

More jugglery with callbacks. Moving stuff from CGameState to CGameInfoCallback. Work on unified game events interface for player (AI or GUI) and script module. Directing events to ERM interpretetr, first attempts of calling some triggers. Crashy, if there any scripts.
Some other changes, including fighting amount of includes in includes and tracking of hero visits (need further work).
2011-05-09 22:20:47 +00:00

29 lines
832 B
C++

#pragma once
#include "..\global.h"
#include "IGameEventsReceiver.h"
class ERMInterpreter;
class DLL_EXPORT CScriptingModule : public IGameEventsReceiver, public IBattleEventsReceiver
{
public:
virtual void init(){}; //called upon the start of game (after map randomization, before first turn)
virtual ~CScriptingModule();
};
class DLL_EXPORT CERMScriptModule : public CScriptingModule
{
public:
ERMInterpreter *interpreter;
CERMScriptModule(void);
~CERMScriptModule(void);
virtual void heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visitedObj, bool start) OVERRIDE;
virtual void init() OVERRIDE;
virtual void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side) OVERRIDE;
};