35 lines
853 B
C++
35 lines
853 B
C++
|
#ifndef id263B7DAF9A1C40BB8517D5D328DF8A1B
|
||
|
#define id263B7DAF9A1C40BB8517D5D328DF8A1B
|
||
|
|
||
|
#include <streambuf>
|
||
|
#include <vector>
|
||
|
|
||
|
namespace dkh {
|
||
|
class AsciiMapSource : std::streambuf {
|
||
|
public:
|
||
|
typedef int MapTileType;
|
||
|
enum {
|
||
|
MapDimensions = 2
|
||
|
};
|
||
|
|
||
|
AsciiMapSource ( void ) = delete;
|
||
|
AsciiMapSource ( const AsciiMapSource& ) = default;
|
||
|
AsciiMapSource ( AsciiMapSource&& parOther ) = delete;
|
||
|
explicit AsciiMapSource ( const char* parFilename );
|
||
|
explicit AsciiMapSource ( const std::string& parFilename );
|
||
|
explicit AsciiMapSource ( std::istream& parData );
|
||
|
template <typename I>
|
||
|
AsciiMapSource ( I parDataFrom, I parDataTo );
|
||
|
~AsciiMapSource ( void ) noexcept = default;
|
||
|
|
||
|
private:
|
||
|
void parse_map_data ( std::istream& parSrc );
|
||
|
|
||
|
std::vector<MapTileType> m_wholedata;
|
||
|
int m_width;
|
||
|
int m_height;
|
||
|
};
|
||
|
} //namespace dk
|
||
|
|
||
|
#endif
|