KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
ControllerDeviceEvent.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "Event.h"
13
14namespace Karma
15{
20 {
21 public:
33 ControllerDeviceConnectedEvent(int cID, int status) : m_ControllerID(cID), m_Status(status)
34 {
35 }
36
40 std::string ToString() const override
41 {
42 std::stringstream ss;
43 ss << "ControllerDeviceConnectedEvent: joystick " << m_ControllerID;
44
45 return ss.str();
46 }
47
48 EVENT_CLASS_TYPE(GameControllerConnected)
50 private:
51 int m_ControllerID;
52 int m_Status;
53 };
54
59 {
60 public:
72 ControllerDeviceDisconnectedEvent(int cID, int status) : m_ControllerID(cID), m_Status(status)
73 {
74 }
75
79 std::string ToString() const override
80 {
81 std::stringstream ss;
82 ss << "ControllerDeviceDisconnectedEvent: joystick " << m_ControllerID;
83
84 return ss.str();
85 }
86
87 EVENT_CLASS_TYPE(GameControllerConnected)
89 private:
90 int m_ControllerID;
91 int m_Status;
92 };
93}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the base class Event for Karma's events.
@ EventCategoryGameControllerDevice
Events belonging to game controller devices' input.
Definition Event.h:65
#define EVENT_CLASS_TYPE(type)
A macro for a template for Event based classes.
Definition Event.h:73
#define EVENT_CLASS_CATEGORY(category)
Macro for the routine category flags.
Definition Event.h:82
ControllerDeviceConnectedEvent(int cID, int status)
A constructor.
Definition ControllerDeviceEvent.h:33
std::string ToString() const override
String representation of the event.
Definition ControllerDeviceEvent.h:40
ControllerDeviceDisconnectedEvent(int cID, int status)
A constructor.
Definition ControllerDeviceEvent.h:72
std::string ToString() const override
String representation of the event.
Definition ControllerDeviceEvent.h:79
The base class of all the events for Karma.
Definition Event.h:88