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