/* Copyright 2015, Michele Santullo * This file is part of DoorKeeper. * * DoorKeeper is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * DoorKeeper is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with DoorKeeper. If not, see . */ #ifndef id372857FBD20C4DD2A9EDDB3A167682AA #define id372857FBD20C4DD2A9EDDB3A167682AA #include "doorkeeper/implem/maptypes.hpp" #include "doorkeeper/primitivetypes.hpp" #include "doorkeeper/helpers/typename.hpp" #include "doorkeeper/implem/coords_utils.hpp" #include #include #include #include #include namespace dk { template class PixelConv; namespace implem { template ::value> class data_fetcher; } //namespace implem template class BaseMapSource { template friend class implem::data_fetcher; public: typedef dk::Vector coords; BaseMapSource ( void ) = default; virtual ~BaseMapSource ( void ) noexcept = default; template void fetch ( std::vector& parOut, const coords& parFrom, const coords& parTo ); virtual const coords& mapSize ( void ) const = 0; virtual const coords& tileSize ( void ) const = 0; virtual MapTypes mapType ( void ) const = 0; virtual int layersCount ( void ) const = 0; virtual void chainedMaps ( std::vector& parOut ) const = 0; virtual HashType layerTypeHash ( int parIndex ) const = 0; virtual const PixelConv& pixel_conv ( void ) const = 0; protected: virtual void fetch_raw ( char* parOut, const coords& parFrom, const coords& parTo, std::size_t parSize ) = 0; }; } //namespace dk #include "doorkeeper/implem/basemapsource.inl" #endif