Placeholder: BlockState
This commit is contained in:
parent
d38f673c63
commit
144c980355
|
@ -0,0 +1,36 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Common.h"
|
||||||
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
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<Feather::BlockState>
|
||||||
|
{
|
||||||
|
size_t operator()(const Feather::BlockState& state) const
|
||||||
|
{
|
||||||
|
using std::hash;
|
||||||
|
using std::string_view;
|
||||||
|
|
||||||
|
return hash<string_view>()(state.GetName());
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue