2015-05-27 22:20:40 +00:00
|
|
|
#ifndef idA52FEA0859494D3FBDF8ED5565091C59
|
|
|
|
#define idA52FEA0859494D3FBDF8ED5565091C59
|
|
|
|
|
|
|
|
#include "doorkeeper/components/tyler.hpp"
|
|
|
|
#include "doorkeeper/components/basemapsource.hpp"
|
2015-06-24 20:13:48 +00:00
|
|
|
#include "doorkeeper/helpers/typename.hpp"
|
2015-06-07 01:57:18 +00:00
|
|
|
#include "doorkeeper/components/exception.hpp"
|
2015-05-27 22:20:40 +00:00
|
|
|
#include <cstdint>
|
|
|
|
#include <utility>
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
#include <map>
|
|
|
|
#include <stack>
|
|
|
|
#include <ciso646>
|
|
|
|
|
|
|
|
namespace dkh {
|
2015-06-07 01:57:18 +00:00
|
|
|
template <uint32_t D>
|
|
|
|
using PushLayerMapType = std::map<dk::HashType, void(dk::Tyler<D>::*)(dk::BaseMapSource<D>*,int)>;
|
|
|
|
|
|
|
|
template <uint32_t D, typename C>
|
2015-05-27 22:20:40 +00:00
|
|
|
struct MapLoaderPool {
|
2015-06-06 12:14:00 +00:00
|
|
|
typedef std::unique_ptr<dk::BaseMapSource<D>> BaseMapSourceUPtr;
|
2015-05-27 22:20:40 +00:00
|
|
|
typedef std::map<std::string, BaseMapSourceUPtr> PoolMapType;
|
|
|
|
|
|
|
|
enum { dimensions = D };
|
|
|
|
typedef C opener_type;
|
|
|
|
|
|
|
|
PoolMapType pool;
|
|
|
|
C opener;
|
|
|
|
|
2015-06-06 12:14:00 +00:00
|
|
|
dk::BaseMapSource<D>* operator() ( const std::string& parName );
|
2015-05-27 22:20:40 +00:00
|
|
|
};
|
|
|
|
|
2015-06-07 01:57:18 +00:00
|
|
|
class UnknownLayerTemplateException : public dk::DoorKeeperException {
|
|
|
|
};
|
|
|
|
|
2015-05-27 22:20:40 +00:00
|
|
|
template <typename M>
|
2015-06-07 01:57:18 +00:00
|
|
|
dk::Tyler<M::dimensions> call_map_load ( M& parFileOpener, const std::string& parOpen, const PushLayerMapType<M::dimensions>& parPusher );
|
2015-05-27 22:20:40 +00:00
|
|
|
|
|
|
|
template <typename M>
|
2015-06-07 01:57:18 +00:00
|
|
|
dk::Tyler<M::dimensions> call_map_load ( dk::Tyler<M::dimensions>& parTyler, M& parFileOpener, const std::string& parOpen, const PushLayerMapType<M::dimensions>& parPusher );
|
|
|
|
|
|
|
|
template <uint32_t D, typename C>
|
|
|
|
dk::Tyler<D> map_load ( C& parFileOpener, const std::string& parOpen, const PushLayerMapType<D>& parPusher );
|
2015-05-27 22:20:40 +00:00
|
|
|
|
2015-06-07 01:57:18 +00:00
|
|
|
template <uint32_t D, typename C>
|
|
|
|
dk::Tyler<D>& map_load ( dk::Tyler<D>& parTyler, C& parFileOpener, const std::string& parOpen, const PushLayerMapType<D>& parPusher );
|
2015-05-27 22:20:40 +00:00
|
|
|
|
2015-06-07 01:57:18 +00:00
|
|
|
namespace implem {
|
|
|
|
template <uint32_t D>
|
|
|
|
void call_push_layer ( dk::Tyler<D>& parTyler, const PushLayerMapType<D>& parPusher, dk::BaseMapSource<D>* parReader, int parIndex );
|
|
|
|
} //namespace implem
|
2015-05-27 22:20:40 +00:00
|
|
|
} //namespace dkh
|
|
|
|
|
|
|
|
#include "doorkeeper/implem/maploader.inl"
|
|
|
|
|
|
|
|
#endif
|