MapView.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * MapView.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../gui/CIntObject.h"
  12. class MapRendererContext;
  13. class MapViewController;
  14. class MapViewModel;
  15. class MapViewCache;
  16. /// Main map rendering class that mostly acts as container for component classes
  17. class MapView : public CIntObject
  18. {
  19. std::shared_ptr<MapViewModel> model;
  20. std::shared_ptr<MapRendererContext> context;
  21. std::unique_ptr<MapViewCache> tilesCache;
  22. std::shared_ptr<MapViewController> controller;
  23. std::shared_ptr<MapViewModel> createModel(const Point & dimensions) const;
  24. public:
  25. std::shared_ptr<const MapViewModel> getModel() const;
  26. std::shared_ptr<MapViewController> getController();
  27. MapView(const Point & offset, const Point & dimensions);
  28. ~MapView() override;
  29. void show(SDL_Surface * to) override;
  30. void showAll(SDL_Surface * to) override;
  31. };