DoorKeeper/include/implem/mapstreambase.inl
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

21 lines
820 B
C++

namespace dk {
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
template <std::size_t D>
MapStreamBase<D>::MapStreamBase (const coords& parMapSize) :
m_mapSize(parMapSize)
{
}
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
template <std::size_t D>
void MapStreamBase<D>::read (char* parOut, std::size_t parOutSize, const coords& parFrom, const coords& parTo) {
DK_ASSERT(parOut);
DK_ASSERT(parOutSize > 0);
DK_ASSERT(this->isReadable());
DK_ASSERT(parFrom < m_mapSize);
DK_ASSERT(parTo <= m_mapSize);
this->dataBlockRequested(parOut, parOutSize, parFrom, parTo);
}
} //namespace dk