1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Added GameInstance class

- available as global GAME
- integrates LOCPLINT (CPlayerInterface)
- integrates CGI->mh (CMapHandler)
- integrates CSH (CServerHandler)
This commit is contained in:
Ivan Savenko
2025-02-11 15:23:33 +00:00
parent ffd37a8fa8
commit 156de5b17e
98 changed files with 1288 additions and 1131 deletions

View File

@@ -15,6 +15,7 @@
#include "../CCallback.h"
#include "../CPlayerInterface.h"
#include "../GameEngine.h"
#include "../GameInstance.h"
#include "../../lib/texts/CGeneralTextHandler.h"
#include "../../lib/TerrainHandler.h"
@@ -67,7 +68,7 @@ std::string CMapHandler::getTerrainDescr(const int3 & pos, bool rightClick) cons
}
}
if(LOCPLINT->cb->getTileDigStatus(pos, false) == EDiggingStatus::CAN_DIG)
if(GAME->interface()->cb->getTileDigStatus(pos, false) == EDiggingStatus::CAN_DIG)
{
return boost::str(
boost::format(rightClick ? "%s\r\n%s" : "%s %s") // New line for the Message Box, space for the Status Bar
@@ -236,11 +237,11 @@ void CMapHandler::removeMapObserver(IMapObjectObserver * object)
IMapObjectObserver::IMapObjectObserver()
{
MAPHANDLER->addMapObserver(this);
GAME->map().addMapObserver(this);
}
IMapObjectObserver::~IMapObjectObserver()
{
if (VLC && MAPHANDLER)
MAPHANDLER->removeMapObserver(this);
GAME->map().removeMapObserver(this);
}