Brunot
Loading...
Searching...
No Matches
PlayAudioMessage.h
Go to the documentation of this file.
1// File: PlayAudioMessage.h
2// Description: Used to tell the AudioSystem to play a sound. Contains the name of the sound to be played.
3// Author(s): Marcelo Escamilla (marcelo.escamilla@digipen.edu)
4// 2025 / 12 / 01
5// (C) Digipen 2025
6// ____ __ __ __
7// /\__ _\/\ \ /\ \/\ \
8// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
9// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
10// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
11// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
12// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
13#pragma once
14#include "Message.h"
15#include <string>
16
17namespace sys
18{
19class Json;
20}
21
22using Stream = sys::Json;
23
25{
26
27 PlayAudioMessage(std::string file);
28 PlayAudioMessage(const PlayAudioMessage& other) = default;
29 PlayAudioMessage(PlayAudioMessage&& other) noexcept = default;
30 auto operator=(const PlayAudioMessage& other) -> PlayAudioMessage& = default;
31 auto operator=(PlayAudioMessage&& other) noexcept -> PlayAudioMessage& = default;
32 ~PlayAudioMessage() override = default;
33
34 auto clone() const -> std::unique_ptr<Message> override
35 {
36 return std::make_unique<PlayAudioMessage>(*this);
37 }
38
39
40 auto load(Stream& stream) -> void override
41 {
42 }
43
44 auto save(Stream& stream) const -> void override
45 {
46 }
47
48 auto getFileName() const -> const std::string&
49 {
50 return fileName;
51 }
52
53private:
54 std::string fileName;
55};
sys::Json Stream
Definition AudioObject.h:20
Definition Json.h:32
the type of elements in a basic_json container
Definition GameObject.h:32
Message()=default
std::string fileName
Definition PlayAudioMessage.h:54
PlayAudioMessage(std::string file)
Definition PlayAudioMessage.cpp:16
auto operator=(PlayAudioMessage &&other) noexcept -> PlayAudioMessage &=default
auto load(Stream &stream) -> void override
Definition PlayAudioMessage.h:40
PlayAudioMessage(const PlayAudioMessage &other)=default
~PlayAudioMessage() override=default
auto getFileName() const -> const std::string &
Definition PlayAudioMessage.h:48
auto save(Stream &stream) const -> void override
Definition PlayAudioMessage.h:44
auto clone() const -> std::unique_ptr< Message > override
Definition PlayAudioMessage.h:34
PlayAudioMessage(PlayAudioMessage &&other) noexcept=default
auto operator=(const PlayAudioMessage &other) -> PlayAudioMessage &=default