R-Type  2
Doom but in better
Loading...
Searching...
No Matches
SoundLib.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** SoundLib.hpp
6*/
7
16#pragma once
17#include <any>
18#include <vector>
19#include <memory>
20#include <optional>
21#include <typeindex>
22#include <unordered_map>
23
24#include "Log.hpp"
25#include "LogMacros.hpp"
26#include "Utilities.hpp"
29
36 public:
42 SoundLib(const std::uint32_t entityId = 0);
48 SoundLib(const std::unordered_map<std::type_index, std::vector<std::any>> &ecsEntities);
55 SoundLib(const std::uint32_t entityId, const std::unordered_map<std::type_index, std::vector<std::any>> &ecsEntities);
56
62 void updateSoundLib(const std::unordered_map<std::type_index, std::vector<std::any>> &ecsEntities);
63
69 void setPlay(const bool play);
75 const bool isEnabled() const;
76
80 void shootSound();
84 void damageSound();
88 void deadSound();
92 void buttonSound();
96 void gameOverSound();
100 void winSound();
101
102 private:
103 bool _playSound = true;
104 std::unordered_map<std::type_index, std::vector<std::any>> _ecsEntities;
105};
This is the file that links the EntityNode children.
Macro definitions for logging messages with varying levels of detail and formatting.
This is the file in charge of containing the Log class (the one in charge of outputing info only when...
This is the file that contains the class in charge of managing music.
The SoundLib class manages sound effects and interactions with ECS entities.
Definition SoundLib.hpp:35
void updateSoundLib(const std::unordered_map< std::type_index, std::vector< std::any > > &ecsEntities)
Updates the sound library with the provided ECS entities.
Definition SoundLib.cpp:53
void buttonSound()
Plays the button interaction sound effect.
Definition SoundLib.cpp:197
void winSound()
Plays the game win sound effect.
Definition SoundLib.cpp:265
void damageSound()
Plays the damage sound effect.
Definition SoundLib.cpp:129
void setPlay(const bool play)
Enables or disables sound playback.
Definition SoundLib.cpp:64
SoundLib(const std::uint32_t entityId=0)
Default constructor.
Definition SoundLib.cpp:21
void shootSound()
Plays the shooting sound effect.
Definition SoundLib.cpp:88
void gameOverSound()
Plays the game over sound effect.
Definition SoundLib.cpp:231
const bool isEnabled() const
Checks if sound playback is enabled.
Definition SoundLib.cpp:75
void deadSound()
Plays the dead sound effect.
Definition SoundLib.cpp:163