RType
Public Member Functions | Protected Attributes | List of all members
IComponent Class Referenceabstract

#include <IComponent.hpp>

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

Public Member Functions

 IComponent (ClientCore *clientCore)
 IComponent, constructor of IComponent. More...
 
virtual ~IComponent ()=default
 ~IComponent, destructor of IComponent More...
 
virtual ComponentType getType () const =0
 getType, get the type of the component More...
 
virtual void action ()=0
 action, action of the component More...
 
virtual void display (sf::RenderWindow &window)=0
 display, display the component More...
 
virtual void addActionTarget (std::shared_ptr< IComponent > component)=0
 addActionTarget, add a target to the action More...
 
virtual void addSubComponent (std::shared_ptr< IComponent > component)=0
 addSubComponent, add a sub component More...
 
virtual void handleEvent (const sf::Event &event, sf::RenderWindow &window)=0
 handleEvent, handle the event More...
 
virtual void setAttribute (std::string attribute)=0
 setAttribute, set the attribute More...
 
virtual std::string getAttribute ()=0
 getAttribute, get the attribute More...
 

Protected Attributes

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 27 of file IComponent.hpp.

Constructor & Destructor Documentation

◆ IComponent()

IComponent::IComponent ( ClientCore clientCore)
inlineexplicit

IComponent, constructor of IComponent.

Definition at line 34 of file IComponent.hpp.

References _clientCore.

Referenced by AComponent::AComponent().

Here is the caller graph for this function:

◆ ~IComponent()

virtual IComponent::~IComponent ( )
virtualdefault

~IComponent, destructor of IComponent

Member Function Documentation

◆ action()

virtual void IComponent::action ( )
pure virtual

action, action of the component

Implemented in TextComponent, SpriteComponent, SoundComponent, MusicComponent, InputComponent, and ButtonComponent.

◆ addActionTarget()

virtual void IComponent::addActionTarget ( std::shared_ptr< IComponent component)
pure virtual

addActionTarget, add a target to the action

Parameters
component

Implemented in AComponent.

◆ addSubComponent()

virtual void IComponent::addSubComponent ( std::shared_ptr< IComponent component)
pure virtual

addSubComponent, add a sub component

Parameters
component

Implemented in AComponent.

◆ display()

virtual void IComponent::display ( sf::RenderWindow &  window)
pure virtual

display, display the component

Parameters
window

Implemented in TextComponent, SpriteComponent, SoundComponent, MusicComponent, InputComponent, and ButtonComponent.

◆ getAttribute()

virtual std::string IComponent::getAttribute ( )
pure virtual

getAttribute, get the attribute

Returns
attribute

Implemented in AComponent.

◆ getType()

virtual ComponentType IComponent::getType ( ) const
pure virtual

getType, get the type of the component

Implemented in AComponent.

◆ handleEvent()

virtual void IComponent::handleEvent ( const sf::Event event,
sf::RenderWindow &  window 
)
pure virtual

handleEvent, handle the event

Parameters
event
window

Implemented in TextComponent, SpriteComponent, SoundComponent, MusicComponent, InputComponent, and ButtonComponent.

◆ setAttribute()

virtual void IComponent::setAttribute ( std::string  attribute)
pure virtual

setAttribute, set the attribute

Parameters
attribute

Implemented in AComponent.

Member Data Documentation

◆ _attribute

std::string IComponent::_attribute
protected

◆ _clientCore

ClientCore* IComponent::_clientCore
protected

◆ _type

ComponentType IComponent::_type
protected

◆ action_target

std::vector<std::shared_ptr<IComponent> > IComponent::action_target
protected

Definition at line 98 of file IComponent.hpp.

◆ sub_components

std::vector<std::shared_ptr<IComponent> > IComponent::sub_components
protected

Definition at line 99 of file IComponent.hpp.


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