2023-02-14 23:49:12 +02:00
|
|
|
/*
|
|
|
|
* MapView.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-02-18 17:37:09 +02:00
|
|
|
#include "../gui/CIntObject.h"
|
2023-02-14 23:49:12 +02:00
|
|
|
|
2023-02-18 17:37:09 +02:00
|
|
|
class MapViewController;
|
2023-02-20 22:16:50 +02:00
|
|
|
class MapViewModel;
|
|
|
|
class MapViewCache;
|
2023-02-18 17:37:09 +02:00
|
|
|
|
|
|
|
/// Main map rendering class that mostly acts as container for component classes
|
|
|
|
class MapView : public CIntObject
|
|
|
|
{
|
|
|
|
std::shared_ptr<MapViewModel> model;
|
|
|
|
std::unique_ptr<MapViewCache> tilesCache;
|
|
|
|
std::shared_ptr<MapViewController> controller;
|
2023-02-14 23:49:12 +02:00
|
|
|
|
2023-02-18 17:37:09 +02:00
|
|
|
std::shared_ptr<MapViewModel> createModel(const Point & dimensions) const;
|
|
|
|
|
|
|
|
public:
|
|
|
|
std::shared_ptr<const MapViewModel> getModel() const;
|
|
|
|
std::shared_ptr<MapViewController> getController();
|
|
|
|
|
|
|
|
MapView(const Point & offset, const Point & dimensions);
|
2023-02-20 22:16:50 +02:00
|
|
|
~MapView() override;
|
2023-02-16 21:35:15 +02:00
|
|
|
|
2023-02-14 23:49:12 +02:00
|
|
|
void show(SDL_Surface * to) override;
|
|
|
|
void showAll(SDL_Surface * to) override;
|
|
|
|
};
|