2014-09-02 14:41:21 +00:00
|
|
|
#ifndef id6FB3FC97331449038D42AAAB4C01ABA1
|
|
|
|
#define id6FB3FC97331449038D42AAAB4C01ABA1
|
|
|
|
|
2015-01-06 15:38:52 +00:00
|
|
|
#include "doorkeeper/components/layer.hpp"
|
2014-09-02 14:41:21 +00:00
|
|
|
#include <vector>
|
2014-12-09 21:30:06 +00:00
|
|
|
#include <cassert>
|
|
|
|
#include <ciso646>
|
2014-12-09 22:53:09 +00:00
|
|
|
#include <memory>
|
2015-01-08 11:20:17 +00:00
|
|
|
#include <cstdint>
|
2014-09-02 14:41:21 +00:00
|
|
|
|
|
|
|
namespace dk {
|
2015-01-08 11:20:17 +00:00
|
|
|
template <typename T, uint32_t D>
|
2014-12-29 15:17:59 +00:00
|
|
|
class TileMapData;
|
|
|
|
|
2015-01-08 11:20:17 +00:00
|
|
|
template <uint32_t D>
|
2014-09-02 14:41:21 +00:00
|
|
|
class Tyler {
|
2014-12-09 22:53:09 +00:00
|
|
|
typedef std::unique_ptr<LayerBase<D>> LayerPtr;
|
|
|
|
typedef std::vector<LayerPtr> LayerList;
|
2014-09-02 14:41:21 +00:00
|
|
|
public:
|
2014-12-09 22:53:09 +00:00
|
|
|
typedef typename LayerBase<D>::coords coords;
|
2014-12-09 21:30:06 +00:00
|
|
|
|
|
|
|
Tyler ( void ) = delete;
|
2014-12-11 22:58:52 +00:00
|
|
|
Tyler ( const coords& parSize, const coords& parTileSize );
|
2014-12-09 22:53:09 +00:00
|
|
|
~Tyler ( void ) noexcept = default;
|
2014-12-09 21:30:06 +00:00
|
|
|
|
2014-12-09 22:53:09 +00:00
|
|
|
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
|
|
|
|
2014-12-09 22:53:09 +00:00
|
|
|
template <typename T>
|
2014-12-29 15:17:59 +00:00
|
|
|
Layer<T, D>& push_layer ( TileMapData<T, D>& parTilemap );
|
2014-12-11 22:58:52 +00:00
|
|
|
template <typename T>
|
2014-12-29 15:17:59 +00:00
|
|
|
Layer<T, D>& push_layer ( TileMapData<T, D>& parTilemap, const coords& parSubdiv );
|
2014-09-02 14:41:21 +00:00
|
|
|
|
2014-12-14 12:13:10 +00:00
|
|
|
void preload ( const coords& parFrom, const coords& parTo );
|
|
|
|
|
2014-09-02 14:41:21 +00:00
|
|
|
private:
|
|
|
|
const coords m_size;
|
2014-12-11 22:58:52 +00:00
|
|
|
const coords m_tilesize;
|
2014-12-09 22:53:09 +00:00
|
|
|
LayerList m_layers;
|
2014-09-02 14:41:21 +00:00
|
|
|
};
|
|
|
|
} //namespace dk
|
|
|
|
|
2015-01-06 15:38:52 +00:00
|
|
|
#include "doorkeeper/implem/tyler.inl"
|
2014-12-09 21:30:06 +00:00
|
|
|
|
2014-09-02 14:41:21 +00:00
|
|
|
#endif
|