CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Action.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Input.hpp"
11
13
16
17#include <functional>
18
19namespace CeresEngine {
20
21 class InputState;
22
23 class CE_SCRIPT_EXPORT(storage = "ref") InputAction {
24 public:
27 bool value = false;
28
29 public:
32
33 public:
37
38 public: // Updating
41 virtual void update(const InputState& state) = 0;
42
46 void updateValue(bool value);
47 };
48
78
111
114
115} // namespace CeresEngine
#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 Action.hpp:79
ModifierButton modifiers
The modifiers that must be pressed with the keys to activate the action.
Definition Action.hpp:86
ButtonOnceInputAction(ButtonSet buttons, ModifierButton modifiers=ModifierButton::None) noexcept
Creates a new button action.
ButtonSet buttons
The buttons that must be pressed to activate the action.
Definition Action.hpp:82
ButtonSet buttons
The buttons that must be pressed to activate the action.
Definition Action.hpp:52
ModifierButton modifiers
The modifiers that must be pressed with the keys to activate the action.
Definition Action.hpp:56
ButtonPressedInputAction(ButtonSet buttons, ModifierButton modifiers=ModifierButton::None) noexcept
Creates a new button action.
Definition Action.hpp:23
Definition InputState.hpp:20
Definition Action.hpp:113
Definition Application.hpp:19
ModifierButton
A enumeration of possible modifier buttons.
Definition Input.hpp:298
@ None
A special modifier button constant that only returns true if no modifier key is pressed.
Button
A enumeration of known buttons.
Definition Input.hpp:25
Vector< Button > ButtonSet
A type that represents a set of buttons.
Definition Input.hpp:176
struct CeresEngine::GLState state
Button button(const StringView &str) noexcept
Returns the Button constant that is represented by str.
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Span.hpp:668