#ifndef OPENMW_COMPONENTS_ESM_VEC2IREFID_HPP #define OPENMW_COMPONENTS_ESM_VEC2IREFID_HPP #include #include #include namespace ESM { class Vec2iRefId { public: constexpr Vec2iRefId() = default; constexpr explicit Vec2iRefId(std::pair value) noexcept : mValue(value) { } std::pair getValue() const { return mValue; } std::string toString() const; std::string toDebugString() const; constexpr bool operator==(Vec2iRefId rhs) const noexcept { return mValue == rhs.mValue; } constexpr bool operator<(Vec2iRefId rhs) const noexcept { return mValue < rhs.mValue; } friend std::ostream& operator<<(std::ostream& stream, Vec2iRefId value); friend struct std::hash; private: std::pair mValue = std::pair(0, 0); }; } namespace std { template <> struct hash { std::size_t operator()(ESM::Vec2iRefId value) const noexcept { return (53 + std::hash{}(value.mValue.first)) * 53 + std::hash{}(value.mValue.second); } }; } #endif