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 "krpch.h"
13
14#include "Event.h"
15
16namespace Karma
17{
22 {
23 public:
35 ControllerDeviceConnectedEvent(int cID, int status) : m_ControllerID(cID), m_Status(status)
36 {
37 }
38
42 std::string ToString() const override
43 {
44 std::stringstream ss;
45 ss << "ControllerDeviceConnectedEvent: joystick " << m_ControllerID;
46
47 return ss.str();
48 }
49
50 EVENT_CLASS_TYPE(GameControllerConnected)
52 private:
53 int m_ControllerID;
54 int m_Status;
55 };
56
61 {
62 public:
74 ControllerDeviceDisconnectedEvent(int cID, int status) : m_ControllerID(cID), m_Status(status)
75 {
76 }
77
81 std::string ToString() const override
82 {
83 std::stringstream ss;
84 ss << "ControllerDeviceDisconnectedEvent: joystick " << m_ControllerID;
85
86 return ss.str();
87 }
88
89 EVENT_CLASS_TYPE(GameControllerConnected)
91 private:
92 int m_ControllerID;
93 int m_Status;
94 };
95}
#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:67
#define EVENT_CLASS_TYPE(type)
A macro for a template for Event based classes.
Definition Event.h:75
#define EVENT_CLASS_CATEGORY(category)
Macro for the routine category flags.
Definition Event.h:84
ControllerDeviceConnectedEvent(int cID, int status)
A constructor.
Definition ControllerDeviceEvent.h:35
std::string ToString() const override
String representation of the event.
Definition ControllerDeviceEvent.h:42
ControllerDeviceDisconnectedEvent(int cID, int status)
A constructor.
Definition ControllerDeviceEvent.h:74
std::string ToString() const override
String representation of the event.
Definition ControllerDeviceEvent.h:81
The base class of all the events for Karma.
Definition Event.h:90