RType
Public Member Functions | List of all members
SoundComponent Class Reference

#include <SoundComponent.hpp>

Inheritance diagram for SoundComponent:
Inheritance graph
[legend]
Collaboration diagram for SoundComponent:
Collaboration graph
[legend]

Public Member Functions

 SoundComponent (ClientCore *core, std::shared_ptr< ClientSocket > socket)
 Construct a new Sound Component:: Sound Component object. More...
 
 ~SoundComponent () override=default
 Destroy the Sound Component:: Sound Component object. More...
 
void action () override
 action, play the sound More...
 
void display (sf::RenderWindow &window) override
 display, display the sound More...
 
void setSound (const std::string &path)
 setSound, set the sound More...
 
void stop ()
 stop, stop the sound More...
 
void handleEvent (const sf::Event &event, sf::RenderWindow &window) override
 handleEvent, handle the event More...
 
- Public Member Functions inherited from AComponent
 AComponent (ClientCore *clientCore)
 AComponent, constructor of AComponent. More...
 
 ~AComponent () override=default
 ~AComponent, destructor of AComponent More...
 
ComponentType getType () const override
 getType, get the type of the component More...
 
void addActionTarget (std::shared_ptr< IComponent > component) override
 addActionTarget, add a target to the action More...
 
void addSubComponent (std::shared_ptr< IComponent > component) override
 addSubComponent, add a sub component More...
 
void setAttribute (std::string attribute) override
 setAttribute, set the attribute More...
 
std::string getAttribute () override
 getAttribute, get the attribute More...
 
- Public Member Functions inherited from IComponent
 IComponent (ClientCore *clientCore)
 IComponent, constructor of IComponent. More...
 
virtual ~IComponent ()=default
 ~IComponent, destructor of IComponent More...
 

Additional Inherited Members

- Protected Attributes inherited from IComponent
std::string _attribute
 
ComponentType _type
 
std::vector< std::shared_ptr< IComponent > > action_target
 
std::vector< std::shared_ptr< IComponent > > sub_components
 
ClientCore_clientCore
 

Detailed Description

Definition at line 13 of file SoundComponent.hpp.

Constructor & Destructor Documentation

◆ SoundComponent()

SoundComponent::SoundComponent ( ClientCore core,
std::shared_ptr< ClientSocket socket 
)
explicit

Construct a new Sound Component:: Sound Component object.

Parameters
core
socket

Definition at line 16 of file SoundComponent.cpp.

References IComponent::_type, AComponent::AComponent(), and SOUND.

Here is the call graph for this function:

◆ ~SoundComponent()

SoundComponent::~SoundComponent ( )
overridedefault

Destroy the Sound Component:: Sound Component object.

Member Function Documentation

◆ action()

void SoundComponent::action ( )
overridevirtual

action, play the sound

Implements IComponent.

Definition at line 33 of file SoundComponent.cpp.

◆ display()

void SoundComponent::display ( sf::RenderWindow &  window)
overridevirtual

display, display the sound

Parameters
window

Implements IComponent.

Definition at line 26 of file SoundComponent.cpp.

◆ handleEvent()

void SoundComponent::handleEvent ( const sf::Event event,
sf::RenderWindow &  window 
)
overridevirtual

handleEvent, handle the event

Parameters
event
window

Implements IComponent.

Definition at line 38 of file SoundComponent.cpp.

◆ setSound()

void SoundComponent::setSound ( const std::string &  path)

setSound, set the sound

Parameters
paththe path of the sound

Definition at line 46 of file SoundComponent.cpp.

◆ stop()

void SoundComponent::stop ( )

stop, stop the sound

Definition at line 56 of file SoundComponent.cpp.


The documentation for this class was generated from the following files: