2015-05-24 15:17:53 +00:00
|
|
|
#ifndef id73F121AEE1EB4BA0980FAC025E5CDF05
|
|
|
|
#define id73F121AEE1EB4BA0980FAC025E5CDF05
|
|
|
|
|
|
|
|
#include "doorkeeper/components/tileiterator.hpp"
|
2015-08-17 15:36:45 +00:00
|
|
|
#include "doorkeeper/implem/maptypes.hpp"
|
|
|
|
#include <cstdint>
|
2015-05-24 15:17:53 +00:00
|
|
|
|
2015-08-17 13:39:28 +00:00
|
|
|
namespace dk {
|
2015-08-17 15:36:45 +00:00
|
|
|
//MapType_IsometricStaggered,
|
|
|
|
//MapType_Isometric,
|
|
|
|
//MapType_Orthogonal,
|
|
|
|
//MapType_Hex
|
|
|
|
template <uint32_t D>
|
|
|
|
class PixelConv {
|
|
|
|
public:
|
|
|
|
typedef Vector<D> coords;
|
|
|
|
|
|
|
|
explicit PixelConv ( MapTypes parType );
|
|
|
|
|
|
|
|
virtual coords to_pixel ( const coords& parFrom, const coords& parSize ) const = 0;
|
|
|
|
MapTypes map_type ( void ) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const MapTypes m_map_type;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <uint32_t D>
|
|
|
|
class PixelConvSquare : public PixelConv<D> {
|
|
|
|
public:
|
|
|
|
using base_class = PixelConv<D>;
|
|
|
|
using typename base_class::coords;
|
|
|
|
|
|
|
|
PixelConvSquare ( void );
|
|
|
|
virtual ~PixelConvSquare ( void ) noexcept = default;
|
|
|
|
|
|
|
|
virtual coords to_pixel ( const coords& parFrom, const coords& parSize ) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PixelConvDiamond : public PixelConv<2> {
|
|
|
|
public:
|
|
|
|
using base_class = PixelConv<2>;
|
|
|
|
using base_class::coords;
|
|
|
|
|
|
|
|
PixelConvDiamond ( bool parStaggered, bool parFirstReentrant );
|
|
|
|
virtual ~PixelConvDiamond ( void ) noexcept = default;
|
|
|
|
|
|
|
|
virtual coords to_pixel ( const coords& parFrom, const coords& parSize ) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
PixelConvDiamond ( MapTypes parType, bool parStaggered, bool parFirstReentrant );
|
|
|
|
};
|
|
|
|
|
|
|
|
class PixelConvHalfDiamond : public PixelConvDiamond {
|
|
|
|
public:
|
|
|
|
using base_class = PixelConvDiamond;
|
|
|
|
using base_class::coords;
|
|
|
|
|
|
|
|
explicit PixelConvHalfDiamond ( bool parHalfVertically );
|
|
|
|
virtual ~PixelConvHalfDiamond ( void ) noexcept = default;
|
|
|
|
|
|
|
|
virtual coords to_pixel ( const coords& parFrom, const coords& parSize ) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const coords m_div;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PixelConvHex : public PixelConv<2> {
|
|
|
|
public:
|
|
|
|
using base_class = PixelConv<2>;
|
|
|
|
using base_class::coords;
|
|
|
|
|
|
|
|
explicit PixelConvHex ( bool parFirstReentrant );
|
|
|
|
virtual ~PixelConvHex ( void ) noexcept = default;
|
|
|
|
|
|
|
|
virtual coords to_pixel ( const coords& parFrom, const coords& parSize ) const;
|
|
|
|
};
|
|
|
|
|
2015-05-24 15:17:53 +00:00
|
|
|
template <typename T, typename T1>
|
2015-08-17 15:36:45 +00:00
|
|
|
Vector<2> get_diamond_coordinates ( const TileIterator<T, 2, T1>& parIterator, const Vector<2>& parSize ) a_pure;
|
2015-05-24 15:17:53 +00:00
|
|
|
|
|
|
|
template <typename T, typename T1>
|
2015-08-17 15:36:45 +00:00
|
|
|
Vector<2> get_half_diamond_coordinates ( const TileIterator<T, 2, T1>& parIterator, const Vector<2>& parSize ) a_pure;
|
2015-05-24 15:17:53 +00:00
|
|
|
|
2015-08-17 11:36:47 +00:00
|
|
|
template <uint32_t D, typename T, typename T1>
|
2015-08-17 15:36:45 +00:00
|
|
|
Vector<D> get_square_coordinates ( const TileIterator<T, D, T1>& parIterator, const Vector<D>& parSize ) a_pure;
|
2015-05-24 15:17:53 +00:00
|
|
|
|
|
|
|
template <typename T, typename T1>
|
2015-08-17 15:36:45 +00:00
|
|
|
Vector<2> get_hex_coordinates ( const TileIterator<T, 2, T1>& parIterator, const Vector<2>& parSize ) a_pure;
|
2015-08-17 13:39:28 +00:00
|
|
|
} //namespace dk
|
2015-05-24 15:17:53 +00:00
|
|
|
|
2015-08-17 13:39:28 +00:00
|
|
|
#include "doorkeeper/implem/pixelconv.inl"
|
2015-05-24 15:17:53 +00:00
|
|
|
|
|
|
|
#endif
|