Brunot
Loading...
Searching...
No Matches
KeyPressedMessage.h
Go to the documentation of this file.
1// File: KeyPressedMessage.h
2// Description: A message sent whenever a key is pressed
3// Author(s): Ori Balashov (ori.balashov@digipen.edu)
4// 2025 / 10 / 24
5// (C) Digipen 2025
6// ____ __ __ __
7// /\__ _\/\ \ /\ \/\ \
8// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
9// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
10// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
11// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
12// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
13#pragma once
14#include "Message.h"
15
16
17namespace sys
18{
19class Json;
20}
21
22using Stream = sys::Json;
23
25{
26 KeyPressedMessage(unsigned int keyInputted);
27 KeyPressedMessage(const KeyPressedMessage& other) = default;
28 KeyPressedMessage(KeyPressedMessage&& other) noexcept = default;
29 auto operator=(const KeyPressedMessage& other) -> KeyPressedMessage& = default;
30 auto operator=(KeyPressedMessage&& other) noexcept -> KeyPressedMessage& = default;
31 ~KeyPressedMessage() override = default;
32
33 auto clone() const -> std::unique_ptr<Message> override
34 {
35 return std::make_unique<KeyPressedMessage>(*this);
36 }
37
38 auto getKeyPressed() const -> unsigned int;
39
40private:
41 unsigned int keyPressed{0};
42};
sys::Json Stream
Definition AudioObject.h:20
Definition Json.h:32
the type of elements in a basic_json container
Definition GameObject.h:32
KeyPressedMessage(const KeyPressedMessage &other)=default
auto operator=(const KeyPressedMessage &other) -> KeyPressedMessage &=default
unsigned int keyPressed
Definition KeyPressedMessage.h:41
KeyPressedMessage(unsigned int keyInputted)
Definition KeyPressedMessage.cpp:17
auto clone() const -> std::unique_ptr< Message > override
Definition KeyPressedMessage.h:33
KeyPressedMessage(KeyPressedMessage &&other) noexcept=default
~KeyPressedMessage() override=default
auto getKeyPressed() const -> unsigned int
Definition KeyPressedMessage.cpp:23
auto operator=(KeyPressedMessage &&other) noexcept -> KeyPressedMessage &=default
Message()=default