#ifndef id263B7DAF9A1C40BB8517D5D328DF8A1B #define id263B7DAF9A1C40BB8517D5D328DF8A1B #include "doorkeeper/primitivetypes.hpp" #include "doorkeeper/implem/vector.hpp" #include "doorkeeper/components/basemapsource.hpp" #include #include namespace dkh { namespace implem { typedef int AsciiMapTileType; } //namespace implem class AsciiMapSource : public dk::BaseMapSource { public: typedef dk::Vector coords; typedef implem::AsciiMapTileType MapTileType; enum { MapDimensions = 2 }; AsciiMapSource ( void ) = delete; AsciiMapSource ( const AsciiMapSource& ) = delete; AsciiMapSource ( AsciiMapSource&& parOther ) = default; AsciiMapSource ( const char* parFilename, const coords& parSize, dk::MapTypes parMapType ); AsciiMapSource ( const std::string& parFilename, const coords& parSize, dk::MapTypes parMapType ); AsciiMapSource ( std::istream& parData, const coords& parSize, dk::MapTypes parMapType ); virtual ~AsciiMapSource ( void ) noexcept = default; virtual const coords& mapSize ( void ) const; virtual void fetch ( std::vector& parOut, const coords& parFrom, const coords& parTo ); virtual dk::MapTypes mapType ( void ) const; virtual int layersCount ( void ) const; private: enum { DataSize = sizeof(MapTileType) }; void parse_map_data ( std::istream& parSrc ); std::vector m_wholedata; const coords m_mapSize; std::size_t m_bytepos; const dk::MapTypes m_mapType; }; } //namespace dkh #endif