Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
input_action.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
#include <string>
11
#include <
toast/assets/data.hpp
>
12
13
namespace
assets {
14
// clang-format off
15
19
enum class
ActionValueType
: uint8_t { action_0d, action_1d, action_2d };
20
27
enum class
AccumulationType
: uint8_t { highest, average };
28
29
// clang-format on
30
34
class
TOAST_API Action :
public
Data {
35
public
:
36
explicit
Action(
const
toml::table& table,
Handle<Schema>
schema = {});
37
38
[[nodiscard]]
39
auto
type()
const
-> std::string_view
override
{
40
return
"input_action"
;
41
}
42
44
[[nodiscard]]
45
auto
get
()
const
-> toml::table;
46
[[nodiscard]]
47
auto
name
()
const
noexcept
-> std::string_view;
48
[[nodiscard]]
49
auto
functionName
()
const
noexcept
-> std::string_view;
50
[[nodiscard]]
51
auto
description
()
const
noexcept
-> std::string_view;
52
[[nodiscard]]
53
auto
valueType
()
const
noexcept
->
ActionValueType
;
54
[[nodiscard]]
55
auto
accumulation
()
const
noexcept
->
AccumulationType
;
56
57
protected
:
58
void
onReloaded()
override
;
59
60
private
:
61
void
readFields();
62
63
std::string m_name;
64
std::string m_function_name;
65
std::string m_description;
66
ActionValueType
m_value_type = ActionValueType::action_0d;
67
AccumulationType
m_accumulation = AccumulationType::highest;
68
};
69
70
}
assets::Action::accumulation
auto accumulation() const noexcept -> AccumulationType
Definition
input_assets.cpp:77
assets::Action::valueType
auto valueType() const noexcept -> ActionValueType
Definition
input_assets.cpp:73
assets::Action::description
auto description() const noexcept -> std::string_view
Definition
input_assets.cpp:69
assets::Action::get
auto get() const -> toml::table
Definition
input_assets.cpp:57
assets::Action::functionName
auto functionName() const noexcept -> std::string_view
Definition
input_assets.cpp:65
assets::Action::name
auto name() const noexcept -> std::string_view
Definition
input_assets.cpp:61
assets::Handle
Type-safe smart pointer for assets.
Definition
core_types.hpp:149
data.hpp
Typed data asset backed by schema-driven TOML.
assets::ActionValueType
ActionValueType
Value domain an action operates in.
Definition
input_action.hpp:19
assets::AccumulationType
AccumulationType
How an action combines values coming from several binds.
Definition
input_action.hpp:27
engine
src
toast
input
assets
input_action.hpp
Generated by
1.17.0