ECSTASY
All in the name
Loading...
Searching...
No Matches
ActionBindings.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_INTEGRATIONS_USER_ACTION_ACTIONBINDINGS_HPP_
13#define ECSTASY_INTEGRATIONS_USER_ACTION_ACTIONBINDINGS_HPP_
14
15#include <vector>
16#include "ActionBinding.hpp"
17#include <toml++/toml.h>
18
20{
28 public:
35 ActionBindings() noexcept = default;
36
45 [[nodiscard]] constexpr std::vector<ActionBinding> &getBindings() noexcept
46 {
47 return _bindings;
48 }
49
58 [[nodiscard]] constexpr const std::vector<ActionBinding> &getBindings() const noexcept
59 {
60 return _bindings;
61 }
62
71 [[nodiscard]] toml::table dump() const noexcept;
72
85 bool load(const toml::table &bindings) noexcept;
86
97 [[nodiscard]] bool contains(ActionBinding action) const noexcept;
98
99 private:
100 // Internal bindings.
102 };
103} // namespace ecstasy::integration::user_action
104
105#endif /* !ECSTASY_INTEGRATIONS_USER_ACTION_ACTIONBINDINGS_HPP_ */
Action binding class, represent a binding between an input and a given action.
Wrapper of a std::vector of ActionBinding.
ActionBindings() noexcept=default
Construct a new empty action binding container.
toml::table dump() const noexcept
Dump the bindings as a toml table.
constexpr std::vector< ActionBinding > & getBindings() noexcept
Get the Bindings.
constexpr const std::vector< ActionBinding > & getBindings() const noexcept
Get the Bindings.
bool load(const toml::table &bindings) noexcept
Load a given toml table representing a list of bindings.
bool contains(ActionBinding action) const noexcept
Check whether action is contained in the internal ActionBinding vector.
User action integration.
Definition Action.hpp:18