Bomberman
Public Member Functions | Public Attributes | List of all members
BBM::TimerComponent Class Reference

#include <TimerComponent.hpp>

Inheritance diagram for BBM::TimerComponent:
Collaboration diagram for BBM::TimerComponent:

Public Member Functions

Componentclone (WAL::Entity &entity) const override
 Clone a component for another or the same entity. More...
 
 TimerComponent (WAL::Entity &entity, std::chrono::nanoseconds delay)
 A default constructor. More...
 
 TimerComponent (WAL::Entity &entity, std::chrono::nanoseconds delay, const WAL::Callback< WAL::Entity &, WAL::Wal & > &timerCallback)
 Create a timer with a callback. More...
 
 TimerComponent (const TimerComponent &)=default
 A timer component is copy constructable. More...
 
 ~TimerComponent () override=default
 A default destructor. More...
 
TimerComponentoperator= (const TimerComponent &)=delete
 A component is not assignable. More...
 
- Public Member Functions inherited from WAL::Component
Componentoperator= (const Component &)=delete
 A component can't be assigned. More...
 
virtual ~Component ()=default
 A virtual destructor. More...
 
virtual void onStart ()
 The entity or this component has just been enabled. More...
 
virtual void onStop ()
 The entity or this component has just been disable. More...
 

Public Attributes

bool disabled = false
 Is the ticking of this component disabled? More...
 
WAL::Callback< WAL::Entity &, WAL::Wal & > callback
 The callback to call when the timer ring. More...
 
std::chrono::nanoseconds ringIn
 The ring delay of this timer component. More...
 

Additional Inherited Members

- Protected Member Functions inherited from WAL::Component
 Component (Entity &entity)
 A component can't be instantiated, it should be derived. More...
 
 Component (const Component &)=default
 A component can't be instantiated, it should be derived. More...
 
- Protected Attributes inherited from WAL::Component
Entity_entity
 The entity that own this component. More...
 

Constructor & Destructor Documentation

◆ TimerComponent() [1/3]

BBM::TimerComponent::TimerComponent ( WAL::Entity entity,
std::chrono::nanoseconds  delay 
)

A default constructor.

◆ TimerComponent() [2/3]

BBM::TimerComponent::TimerComponent ( WAL::Entity entity,
std::chrono::nanoseconds  delay,
const WAL::Callback< WAL::Entity &, WAL::Wal & > &  timerCallback 
)

Create a timer with a callback.

◆ TimerComponent() [3/3]

BBM::TimerComponent::TimerComponent ( const TimerComponent )
default

A timer component is copy constructable.

◆ ~TimerComponent()

BBM::TimerComponent::~TimerComponent ( )
overridedefault

A default destructor.

Member Function Documentation

◆ clone()

WAL::Component * BBM::TimerComponent::clone ( WAL::Entity entity) const
overridevirtual

Clone a component for another or the same entity.

Parameters
entityThe entity that owns the ne component.

Implements WAL::Component.

◆ operator=()

TimerComponent& BBM::TimerComponent::operator= ( const TimerComponent )
delete

A component is not assignable.

Member Data Documentation

◆ callback

WAL::Callback<WAL::Entity &, WAL::Wal &> BBM::TimerComponent::callback

The callback to call when the timer ring.

◆ disabled

bool BBM::TimerComponent::disabled = false

Is the ticking of this component disabled?

◆ ringIn

std::chrono::nanoseconds BBM::TimerComponent::ringIn

The ring delay of this timer component.


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