SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
InputableAttorney.h
1#ifndef InputableAttorney_H
2#define InputableAttorney_H
3
4#include "Inputable.h"
5#include "../EventType.h"
6
9
18{
19public:
25 {
26 private:
27 friend class KeyboardEventManager;
28 friend class SingleKeyEventManager;
29 friend class MouseKeyEventManager;
30
36 static void ProcessKeyInactive(Inputable* in, AZUL_KEY k) { in->KeyInactive(k); };
37
43 static void ProcessKeyPress(Inputable* in, AZUL_KEY k) { in->KeyPress(k); };
44
50 static void ProcessKeyHeld(Inputable* in, AZUL_KEY k) { in->KeyHeld(k); };
51
57 static void ProcessKeyRelease(Inputable* in, AZUL_KEY k) { in->KeyRelease(k); };
58
64 static void ProcessMouseKeyInactive(Inputable* in, AZUL_MOUSE m) { in->MouseInactive(m); };
65
71 static void ProcessMouseKeyPress(Inputable* in, AZUL_MOUSE m) { in->MousePress(m); };
72
78 static void ProcessMouseKeyHeld(Inputable* in, AZUL_MOUSE m) { in->MouseHeld(m); };
79
85 static void ProcessMouseKeyRelease(Inputable* in, AZUL_MOUSE m) { in->MouseRelease(m); };
86
87
95 static void SetDeleteRef(Inputable* in, AZUL_KEY k, EventType e, KeyboardEventManager::StorageMapRef& ref) { Inputable::KeyEventPair keyEventPair{ k, e }; in->keyMap[keyEventPair]->pMyDeleteRef = ref; };
96
104 static void SetDeleteRef(Inputable* in, AZUL_MOUSE m, EventType e, KeyboardEventManager::StorageMapMouseRef& ref) { Inputable::MouseKeyEventPair mouseKeyEventPair{ m, e }; in->mouseKeyMap[mouseKeyEventPair]->pMyDeleteRef = ref; };
105
113 static KeyboardEventManager::StorageMapRef& GetRef(Inputable* in, AZUL_KEY k, EventType e) { Inputable::KeyEventPair keyEventPair{ k, e }; return in->keyMap[keyEventPair]->pMyDeleteRef; };
114
122 static KeyboardEventManager::StorageMapMouseRef& GetRef(Inputable* in, AZUL_MOUSE m, EventType e) { Inputable::MouseKeyEventPair mouseKeyEventPair{ m, e }; return in->mouseKeyMap[mouseKeyEventPair]->pMyDeleteRef; };
123 };
124
130 {
131 private:
132 friend class KeyRegistrationCommand;
133 friend class KeyDeregistrationCommand;
134 friend class MouseKeyRegistrationCommand;
135 friend class MouseKeyDeregistrationCommand;
136
143 static void KeyRegistration(Inputable* in, AZUL_KEY k, EventType e) { in->KeyRegistration(k, e); };
144
151 static void KeyDeregistration(Inputable* in, AZUL_KEY k, EventType e) { in->KeyDeregistration(k, e); };
152
159 static void MouseKeyRegistration(Inputable* in, AZUL_MOUSE m, EventType e) { in->MouseKeyRegistration(m, e); };
160
167 static void MouseKeyDeregistration(Inputable* in, AZUL_MOUSE m, EventType e) { in->MouseKeyDeregistration(m, e); };
168 };
169};
170
171#endif
Defines the event types for input handling.
EventType
Enum class representing the types of input events.
Definition EventType.h:19
Provides access to the game loop related functions of Inputable.
Definition InputableAttorney.h:25
static KeyboardEventManager::StorageMapRef & GetRef(Inputable *in, AZUL_KEY k, EventType e)
Retrieves the storage map reference for the Inputable object.
Definition InputableAttorney.h:113
static void ProcessKeyPress(Inputable *in, AZUL_KEY k)
Processes the key press event for the Inputable object.
Definition InputableAttorney.h:43
static void ProcessKeyRelease(Inputable *in, AZUL_KEY k)
Processes the key release event for the Inputable object.
Definition InputableAttorney.h:57
static void ProcessMouseKeyPress(Inputable *in, AZUL_MOUSE m)
Processes the key press event for the Inputable object.
Definition InputableAttorney.h:71
static void ProcessMouseKeyRelease(Inputable *in, AZUL_MOUSE m)
Processes the key release event for the Inputable object.
Definition InputableAttorney.h:85
static void SetDeleteRef(Inputable *in, AZUL_KEY k, EventType e, KeyboardEventManager::StorageMapRef &ref)
Sets the delete reference for the Inputable object.
Definition InputableAttorney.h:95
static KeyboardEventManager::StorageMapMouseRef & GetRef(Inputable *in, AZUL_MOUSE m, EventType e)
Retrieves the storage map reference for the Inputable object.
Definition InputableAttorney.h:122
static void ProcessKeyInactive(Inputable *in, AZUL_KEY k)
Processes the key inactive event for the Inputable object.
Definition InputableAttorney.h:36
static void ProcessMouseKeyInactive(Inputable *in, AZUL_MOUSE m)
Processes the key inactive event for the Inputable object.
Definition InputableAttorney.h:64
static void ProcessKeyHeld(Inputable *in, AZUL_KEY k)
Processes the key held event for the Inputable object.
Definition InputableAttorney.h:50
static void SetDeleteRef(Inputable *in, AZUL_MOUSE m, EventType e, KeyboardEventManager::StorageMapMouseRef &ref)
Sets the delete reference for the Inputable object.
Definition InputableAttorney.h:104
static void ProcessMouseKeyHeld(Inputable *in, AZUL_MOUSE m)
Processes the key held event for the Inputable object.
Definition InputableAttorney.h:78
Provides access to the registration related functions of Inputable.
Definition InputableAttorney.h:130
static void KeyDeregistration(Inputable *in, AZUL_KEY k, EventType e)
Deregisters the key for the Inputable object.
Definition InputableAttorney.h:151
static void KeyRegistration(Inputable *in, AZUL_KEY k, EventType e)
Registers the key for the Inputable object.
Definition InputableAttorney.h:143
static void MouseKeyRegistration(Inputable *in, AZUL_MOUSE m, EventType e)
Registers the key for the Inputable object.
Definition InputableAttorney.h:159
static void MouseKeyDeregistration(Inputable *in, AZUL_MOUSE m, EventType e)
Deregisters the key for the Inputable object.
Definition InputableAttorney.h:167
Provides controlled access to the Inputable class for specific classes.
Definition InputableAttorney.h:18
Base class for objects that can handle keyboard input events.
Definition Inputable.h:23
void MouseKeyDeregistration(AZUL_MOUSE m, EventType e)
Deregisters the mouse key for the GameObject.
Definition Inputable.cpp:127
void KeyRegistration(AZUL_KEY k, EventType e)
Registers the key for the GameObject.
Definition Inputable.cpp:97
void MouseKeyRegistration(AZUL_MOUSE m, EventType e)
Registers the mouse key for the GameObject.
Definition Inputable.cpp:117
virtual void MousePress(AZUL_MOUSE m)
Virtual method to be implemented by derived classes for mouse press functionality.
Definition Inputable.h:185
KeyMap keyMap
The key map of the GameObject.
Definition Inputable.h:144
virtual void KeyPress(AZUL_KEY k)
Virtual method to be implemented by derived classes for key press functionality.
Definition Inputable.h:161
void KeyDeregistration(AZUL_KEY k, EventType e)
Deregisters the key for the GameObject.
Definition Inputable.cpp:107
virtual void KeyInactive(AZUL_KEY k)
Virtual method to be implemented by derived classes for key inactive functionality.
Definition Inputable.h:155
virtual void KeyRelease(AZUL_KEY k)
Virtual method to be implemented by derived classes for key release functionality.
Definition Inputable.h:173
virtual void KeyHeld(AZUL_KEY k)
Virtual method to be implemented by derived classes for key held functionality.
Definition Inputable.h:167
virtual void MouseHeld(AZUL_MOUSE m)
Virtual method to be implemented by derived classes for mouse held functionality.
Definition Inputable.h:191
MouseKeyMap mouseKeyMap
The mouse key map of the GameObject.
Definition Inputable.h:149
virtual void MouseInactive(AZUL_MOUSE m)
Virtual method to be implemented by derived classes for mouse inactive functionality.
Definition Inputable.h:179
virtual void MouseRelease(AZUL_MOUSE m)
Virtual method to be implemented by derived classes for mouse release functionality.
Definition Inputable.h:197
Manages the registration and processing of keyboard events for GameObjects.
Definition KeyboardEventManager.h:19
MapMouseKeyManager::iterator StorageMapMouseRef
Type alias for the storage map mouse iterator.
Definition KeyboardEventManager.h:92
MapKeyManager::iterator StorageMapRef
Type alias for the storage map iterator.
Definition KeyboardEventManager.h:87
Manages the registration and processing of a single key event for GameObjects.
Definition SingleKeyEventManager.h:18
Structure to hold key event pairs.
Definition Inputable.h:87
Structure to hold mouse key event pairs.
Definition Inputable.h:106