DoorKeeper/include/helpers/asciimapsource.hpp
King_DuckZ 931acf3293 2D ascii tile loader refactored out of TileStreamer.
This also adds a static lib part to DoorKeeper that will only contain helper functions.
2014-12-22 16:59:09 +01:00

34 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