Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
input_layout.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
#include <string>
11
#include <
toast/assets/data.hpp
>
12
#include <vector>
13
14
namespace
assets {
15
19
class
TOAST_API
InputLayout
:
public
Data {
20
public
:
22
static
constexpr
std::string_view
default_layer
=
"default"
;
23
27
struct
Entry
{
28
toast::UID
id
;
29
std::vector<std::string>
included
;
30
std::vector<std::string>
excluded
;
31
};
32
33
// clang-format off
34
// if you are asking why it;s because goofy ahh clang format alings
35
// the doxygen to the previous documentation -x
36
41
explicit
InputLayout
(
const
toml::table& table,
Handle<Schema>
schema = {});
42
// clang-format on
43
44
[[nodiscard]]
45
auto
type() const -> std::string_view
override
{
46
return
"input_layout"
;
47
}
48
50
[[nodiscard]]
51
auto
name() const noexcept -> std::string_view;
52
54
[[nodiscard]]
55
auto layers() const noexcept -> const std::vector<std::
string
>&;
56
58
[[nodiscard]]
59
auto entries() const noexcept -> const std::vector<Entry>&;
60
67
[[nodiscard]]
68
static auto isActiveForLayer(const Entry& entry, std::string_view layer) noexcept ->
bool
;
69
70
protected:
71
void
onReloaded() override;
72
73
private:
74
void
readFields();
75
76
std::
string
m_name;
77
std::vector<std::
string
> m_layers;
78
std::vector<Entry> m_entries;
79
};
80
81
}
assets::Handle
Type-safe smart pointer for assets.
Definition
core_types.hpp:149
assets::InputLayout::InputLayout
InputLayout(const toml::table &table, Handle< Schema > schema={})
Parses the layout from a TOML table, keeping all keys for round-trip serialization.
Definition
input_assets.cpp:81
assets::InputLayout::default_layer
static constexpr std::string_view default_layer
Hidden layer that is always present in every layout.
Definition
input_layout.hpp:22
data.hpp
Typed data asset backed by schema-driven TOML.
assets::InputLayout::Entry
One action reference inside a layout.
Definition
input_layout.hpp:27
assets::InputLayout::Entry::id
toast::UID id
UID of the referenced asset::Action.
Definition
input_layout.hpp:28
assets::InputLayout::Entry::excluded
std::vector< std::string > excluded
layers this action is blacklisted from
Definition
input_layout.hpp:30
assets::InputLayout::Entry::included
std::vector< std::string > included
layers this action is whitelisted for; empty means every layer
Definition
input_layout.hpp:29
toast::UID
Definition
uid.hpp:20
engine
src
toast
input
assets
input_layout.hpp
Generated by
1.17.0