DoorKeeper/include/implem/tyler.inl
King_DuckZ 1e5f4fd2f0 Adding the concept of layers.
Deferring the data loading task to lower level classes.
test_tiler removed as Tyler won't require the user to derive from it anymore.
2014-12-09 23:53:09 +01:00

31 lines
1.1 KiB
C++

namespace dk {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
template <size_t D>
Tyler<D>::Tyler (const coords& parSize) :
m_size(parSize)
{
assert(m_size.x() > 0 and m_size.y() > 0);
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
template <size_t D>
typename Tyler<D>::coords::value_type Tyler<D>::tiles_count() const {
typename coords::value_type retval = 1;
for (size_t d = 0; d < D; ++d) {
retval *= m_size[d];
}
return retval;
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
template <size_t D>
template <typename T>
size_t Tyler<D>::push_layer (typename Layer<T, D>::streamer_type&& parStreamer) {
const size_t retval = m_layers.size();
m_layers.push_back(LayerPtr(new Layer<T, D>(m_size, std::move(parStreamer))));
return retval;
}
} //namespace dk