DoorKeeper/include/doorkeeper/components/tyler.hpp

50 lines
1.3 KiB
C++
Raw Normal View History

2014-09-02 14:41:21 +00:00
#ifndef id6FB3FC97331449038D42AAAB4C01ABA1
#define id6FB3FC97331449038D42AAAB4C01ABA1
#include "doorkeeper/components/layer.hpp"
#include "doorkeeper/components/exception.hpp"
2014-09-02 14:41:21 +00:00
#include <vector>
#include <cassert>
#include <ciso646>
#include <memory>
#include <cstdint>
2014-09-02 14:41:21 +00:00
namespace dk {
template <uint32_t D>
class BaseMapSource;
template <uint32_t D>
2014-09-02 14:41:21 +00:00
class Tyler {
typedef std::unique_ptr<LayerBase<D>> LayerPtr;
typedef std::vector<LayerPtr> LayerList;
2014-09-02 14:41:21 +00:00
public:
typedef typename LayerBase<D>::coords coords;
Tyler ( void ) = delete;
Tyler ( Tyler&& ) = default;
explicit Tyler ( const coords& parTileSize );
~Tyler ( void ) noexcept = default;
typename coords::value_type tiles_count ( void ) const;
const coords& map_size ( void ) const { return m_size; }
2014-12-12 19:04:48 +00:00
template <typename T>
Layer<T, D>& push_layer ( BaseMapSource<D>* parTilemap, int parIndex );
template <typename T>
Layer<T, D>& push_layer ( BaseMapSource<D>* parTilemap, const coords& parSubdiv, int parIndex );
template <typename T>
void push_layer_void ( BaseMapSource<D>* parTilemap, int parIndex );
2014-09-02 14:41:21 +00:00
void preload ( const coords& parFrom, const coords& parTo );
2014-09-02 14:41:21 +00:00
private:
coords m_size;
const coords m_tilesize;
LayerList m_layers;
2014-09-02 14:41:21 +00:00
};
} //namespace dk
#include "doorkeeper/implem/tyler.inl"
2014-09-02 14:41:21 +00:00
#endif