71 operator u16() const noexcept {
76inline bool operator==(
const Id& rhs,
const Id& lhs) {
77 return rhs.action_category == lhs.action_category && rhs.action_index == lhs.action_index;
86struct hash<nnl::action::Id> {
87 size_t operator()(
const nnl::action::Id&
id)
const {
return hash<size_t>{}(
static_cast<nnl::u16>(id)); }
Provides functions and classes for handling binary data.
Contains macros and definitions for fixed-width types.
u16 action_index
The index within the category.
Definition action_common.hpp:69
ActionCategory action_category
Type of the action.
Definition action_common.hpp:68
Represents a unique identifier for an action.
Definition action_common.hpp:67
constexpr std::size_t kNumActionCategories
Defines the number of action categories;.
Definition action_common.hpp:34
constexpr std::size_t kMaxActionIndex
Defines the maximum index of an action in a category;.
Definition action_common.hpp:42
ActionCategory
Defines the categories of actions.
Definition action_common.hpp:51
@ kMovement
Related to moving the entity.
Definition action_common.hpp:52
@ kCombat
Related to attacking behaviors.
Definition action_common.hpp:53
@ kDamage
Related to receiving damage.
Definition action_common.hpp:54
@ kCutscene
Related to scripted events or cutscenes.
Definition action_common.hpp:55
constexpr std::underlying_type< E >::type as_int(E e) noexcept
Converts an enum value to its underlying integer type.
Definition data.hpp:68
std::uint16_t u16
16-bit unsigned integer
Definition fixed_type.hpp:62
Contains structures and functions for working with game actions.
Definition action.hpp:31
Definition exception.hpp:56