#pragma once #include #include #include #include #include #include #include "region.h" #include "maze.h" namespace ext { class EXT_API Terrain : public uf::Object { protected: public: virtual void initialize(); virtual void render(); virtual void destroy(); virtual void tick(); void relocateChildren(); bool exists( const pod::Vector3i& ) const; bool inBounds( const pod::Vector3i& ) const; ext::Region* at( const pod::Vector3i& ) const; void generate( bool single = false ); void generate( const pod::Vector3i& ); void degenerate( const pod::Vector3i& ); }; } namespace std { template<> struct hash { size_t operator()(pod::Vector3i const& vertex) const { std::size_t seed = 3; std::hash hasher; for ( size_t i = 0; i < 3; ++i ) seed ^= hasher( vertex[i] ) + 0x9e3779b9 + (seed << 6) + (seed >> 2); return seed; } }; }