EHS/src/io/hid/Button.cpp

50 lines
663 B
C++
Raw Normal View History

2024-02-05 22:25:30 -08:00
#include "ehs/io/hid/Button.h"
namespace ehs
{
Button::Button()
: hash(0)
{
}
Button::Button(const Str_8& name)
: name(name), hash(name.Hash_32())
{
}
Button::Button(const Button& key)
: name(key.name), hash(key.hash)
{
}
Button& Button::operator=(const Button& key)
{
if (this == &key)
return *this;
name = key.name;
hash = key.hash;
return *this;
}
bool Button::operator==(const Button& key) const
{
return key.hash == hash;
}
bool Button::operator!=(const Button& key) const
{
return key.hash != hash;
}
Str_8 Button::GetName() const
{
return name;
}
UInt_32 Button::GetHash() const
{
return hash;
}
}