57 template<typename T, typename... Args> T& add(const
StringView& name, Args&&... args);
64 void active(
bool state) noexcept;
68 bool isActive() const noexcept;
96 return static_cast<Action&
>(addAction(name, ce_unique_new<Action>(std::forward<Args>(args)...)));
131 return static_cast<Range&
>(addRange(name, ce_unique_new<Range>(std::forward<Args>(args)...)));
156 static_assert(std::is_base_of_v<InputAction, T> || std::is_base_of_v<InputRange, T>,
"T must be either an Action or a Range!");
157 if constexpr(std::is_base_of_v<InputAction, T>) {
159 }
else if constexpr(std::is_base_of_v<InputRange, T>) {
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition InputContext.hpp:24
T & add(const StringView &name, Args &&... args)
Add a new Action or Range to the context.
Definition InputContext.hpp:155
InputRange & addRange(const StringView &name, UPtr< InputRange > range)
Add a new range with the given name.
void update(const InputState &state)
Update all actions and ranges with the given input state.
Map< String, UPtr< InputRange > > ranges
A map of all ranges registered with the context.
Definition InputContext.hpp:33
Map< String, UPtr< InputAction > > actions
A map of all actions registered with the context.
Definition InputContext.hpp:30
InputAction & addAction(const StringView &name, UPtr< InputAction > action)
Add a new action with the given name.
Definition Application.hpp:19
std::unique_ptr< T, Deleter > UPtr
UPtr is a smart pointer that owns and manages another object through a pointer and disposes of that o...
Definition SmartPtr.hpp:28
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::map< Key, T, Compare, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > Map
Map is a sorted associative container that contains key-value pairs with unique keys.
Definition Map.hpp:24