mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-18 17:40:48 +02:00
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
|
#ifndef MAPCONTROLLER_H
|
||
|
#define MAPCONTROLLER_H
|
||
|
|
||
|
#include "maphandler.h"
|
||
|
#include "mapview.h"
|
||
|
#include "../lib/mapping/CMap.h"
|
||
|
#include "../lib/Terrain.h"
|
||
|
|
||
|
class MainWindow;
|
||
|
class MapController
|
||
|
{
|
||
|
public:
|
||
|
MapController(MainWindow *);
|
||
|
MapController(const MapController &) = delete;
|
||
|
MapController(const MapController &&) = delete;
|
||
|
~MapController();
|
||
|
|
||
|
void setMap(std::unique_ptr<CMap>);
|
||
|
|
||
|
CMap * map();
|
||
|
MapHandler * mapHandler();
|
||
|
MapScene * scene(int level);
|
||
|
|
||
|
void resetMapHandler();
|
||
|
|
||
|
void sceneForceUpdate();
|
||
|
void sceneForceUpdate(int level);
|
||
|
|
||
|
void commitTerrainChange(int level, const Terrain & terrain);
|
||
|
void commitObjectErase(int level);
|
||
|
void commitObstacleFill(int level);
|
||
|
void commitChangeWithoutRedraw();
|
||
|
void commitObjectShiftOrCreate(int level);
|
||
|
void commitObjectCreate(int level);
|
||
|
void commitObjectChange(int level);
|
||
|
|
||
|
bool discardObject(int level) const;
|
||
|
void createObject(int level, CGObjectInstance * obj) const;
|
||
|
|
||
|
private:
|
||
|
MainWindow * _main;
|
||
|
std::unique_ptr<CMap> _map;
|
||
|
std::unique_ptr<MapHandler> _mapHandler;
|
||
|
mutable std::array<MapScene *, 2> _scenes;
|
||
|
};
|
||
|
|
||
|
#endif // MAPCONTROLLER_H
|