From 144c9803558a330a70b2ee33b1dc6048860d9ae9 Mon Sep 17 00:00:00 2001 From: DankParrot Date: Wed, 12 Aug 2020 20:05:25 -0700 Subject: [PATCH] Placeholder: BlockState --- src/block/state/BlockState.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/block/state/BlockState.h diff --git a/src/block/state/BlockState.h b/src/block/state/BlockState.h new file mode 100644 index 0000000..2b962dc --- /dev/null +++ b/src/block/state/BlockState.h @@ -0,0 +1,36 @@ +#pragma once + +#include "Common.h" +#include +#include +#include + +namespace Feather +{ + class BlockState + { + // PLACEHOLDER + std::string_view m_name; + public: + BlockState(std::string_view name) : m_name(name) {} + + inline const std::string_view GetName() const { return m_name; } + + inline bool operator ==(const BlockState that) const + { + return m_name == that.m_name; + } + }; +} + +template <> +struct std::hash +{ + size_t operator()(const Feather::BlockState& state) const + { + using std::hash; + using std::string_view; + + return hash()(state.GetName()); + } +}; \ No newline at end of file