DoorKeeper/include/components/tilemapdata.hpp
King_DuckZ 436d738620 Refactoring in map reading code - part 1/2
Fixed a bug when iterating over a view that was smaller than the map size
Added a class to abstract map readers
2015-01-05 18:01:28 +01:00

34 lines
870 B
C++

#ifndef id8F5106DFABC14263ADF235C56E434207
#define id8F5106DFABC14263ADF235C56E434207
#include "primitivetypes.hpp"
#include "implem/compatibility.h"
#include "implem/vector.hpp"
#include "implem/helpers.hpp"
#include "mapreaders/mapstreambase.hpp"
#include <cstddef>
#include <iterator>
#include <memory>
#include <algorithm>
namespace dk {
template <typename T, std::size_t D>
class TileMapData {
public:
typedef Vector<CoordinateScalarType, D> coords;
TileMapData ( void ) = delete;
explicit TileMapData ( std::unique_ptr<MapStreamBase<D>>&& parStream );
~TileMapData ( void ) noexcept = default;
void fetch ( std::vector<T>& parOut, const coords& parFrom, const coords& parTo );
const coords& mapSize ( void ) const;
private:
const std::unique_ptr<MapStreamBase<D>> m_mapstream;
};
} //namespace dk
#include "implem/tilemapdata.inl"
#endif