BaseMapSource doesn't need to know T. Only fetch() will need that.

This commit is contained in:
King_DuckZ 2015-06-06 14:14:00 +02:00
parent 49f7d15379
commit ab6ef6c338
14 changed files with 42 additions and 40 deletions

View file

@ -12,7 +12,7 @@ namespace dkh {
typedef int AsciiMapTileType;
} //namespace implem
class AsciiMapSource : public dk::BaseMapSource<implem::AsciiMapTileType, 2> {
class AsciiMapSource : public dk::BaseMapSource<2> {
public:
typedef dk::Vector<2> coords;
typedef implem::AsciiMapTileType MapTileType;
@ -29,18 +29,14 @@ namespace dkh {
virtual ~AsciiMapSource ( void ) noexcept = default;
virtual const coords& mapSize ( void ) const;
virtual void fetch ( std::vector<MapTileType>& parOut, const coords& parFrom, const coords& parTo );
virtual dk::MapTypes mapType ( void ) const;
virtual int layersCount ( void ) const;
virtual const coords& tileSize ( void ) const;
virtual void chainedMaps ( std::vector<std::string>& parOut ) const;
private:
enum {
DataSize = sizeof(MapTileType)
};
void parse_map_data ( std::istream& parSrc );
virtual void fetch_raw ( char* parOut, const coords& parFrom, const coords& parTo, std::size_t parSize );
std::vector<MapTileType> m_wholedata;
const coords m_mapSize;