Go to the documentation of this file.
63 const std::map<SoundIndex, std::string> &,
64 bool isLonely =
false);
76 std::map<SoundIndex, std::shared_ptr<RAY::Audio::Sound>>
_soundList;
SoundIndex _soundIndex
SoundIndex.
Definition: SoundComponent.hpp:84
void setIndex(SoundIndex index)
to set what sound should be played
Definition: SoundComponent.cpp:82
@ DEATH
Definition: SoundComponent.hpp:26
@ BOMB
Definition: SoundComponent.hpp:22
~SoundComponent() override=default
A default destructor.
SoundIndex
All sounds of the player.
Definition: SoundComponent.hpp:19
void turnDownVolume()
volume -= 0.1
Definition: SoundComponent.cpp:92
@ IDLE
Definition: SoundComponent.hpp:20
std::map< SoundIndex, std::shared_ptr< RAY::Audio::Sound > > _soundList
Sounds of this entity.
Definition: SoundComponent.hpp:76
Represent a single component of WAL.
Definition: Component.hpp:17
Definition: AnimationsComponent.cpp:9
bool isPlaying()
is Sound playing
Definition: SoundComponent.cpp:75
An entity of the WAL's ECS.
Definition: Entity.hpp:20
SoundIndex getIndex()
to know which sound is selected
Definition: SoundComponent.cpp:87
void turnUpVolume()
volume += 0.1
Definition: SoundComponent.cpp:97
@ HURT
Definition: SoundComponent.hpp:24
SoundComponent(WAL::Entity &entity, const std::map< SoundIndex, std::string > &, bool isLonely=false)
Create a new SoundComponent at a certain Sound.
WAL::Component * clone(WAL::Entity &entity) const override
Clone a component for another or the same entity.
Definition: SoundComponent.cpp:31
SoundComponent & operator=(const SoundComponent &)=delete
A Sound component is not assignable.
void stopSound()
stop sound
Definition: SoundComponent.cpp:44
void playSound()
start sound
Definition: SoundComponent.cpp:36
void setPitch(float)
set pitch volume
Definition: SoundComponent.cpp:68
static float volume
Volume of the sounds.
Definition: SoundComponent.hpp:72
bool _isLonely
to know if cache is needed
Definition: SoundComponent.hpp:80
void pauseSound()
put Sound on hold
Definition: SoundComponent.cpp:52
std::map< SoundIndex, bool > _isSoundLoad
map to know if sound is loaded
Definition: SoundComponent.hpp:78
@ MOVE
Definition: SoundComponent.hpp:23
A basic Sound component.
Definition: SoundComponent.hpp:14
@ THROW
Definition: SoundComponent.hpp:25
@ JUMP
Definition: SoundComponent.hpp:21
void setVolume(float)
set Sound volume
Definition: SoundComponent.cpp:59
const std::map< SoundIndex, std::string > _soundPath
All sounds path.
Definition: SoundComponent.hpp:82