namespace dk { ///------------------------------------------------------------------------- ///------------------------------------------------------------------------- template TileMapData::TileMapData (std::unique_ptr>&& parStream) : m_mapstream(std::move(parStream)) { } ///------------------------------------------------------------------------- ///------------------------------------------------------------------------- template void TileMapData::fetch (std::vector& parOut, const coords& parFrom, const coords& parTo) { DK_ASSERT(parFrom >= coords(0)); DK_ASSERT(parFrom < parTo); DK_ASSERT(parFrom < m_mapstream->mapSize()); DK_ASSERT(parTo <= m_mapstream->mapSize()); const auto tileCount = implem::area(parTo - parFrom); parOut.resize(tileCount); m_mapstream->read( reinterpret_cast(parOut.data()), parOut.size() * sizeof(typename std::vector::value_type), parFrom, parTo); } ///------------------------------------------------------------------------- ///------------------------------------------------------------------------- template const typename TileMapData::coords& TileMapData::mapSize() const { return m_mapstream->mapSize(); } } //namespace dk