Bomberman
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WAL::System< Dependencies > Class Template Reference

A base system of WAL. More...

#include <System.hpp>

Inheritance diagram for WAL::System< Dependencies >:
Collaboration diagram for WAL::System< Dependencies >:

Public Member Functions

 ~System () override=default
 A virtual, default, destructor. More...
 
 System (System &&) noexcept=default
 A system can be moved. More...
 
View< Dependencies... > & getView () override
 Get a view of all entities containing every dependencies of this system. More...
 
virtual void onUpdate (ViewEntity< Dependencies... > &entity, std::chrono::nanoseconds dtime)
 Update the corresponding component of the given entity. More...
 
virtual void onFixedUpdate (ViewEntity< Dependencies... > &entity)
 An alternative of onUpdate that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up. More...
 
virtual void onSelfUpdate (std::chrono::nanoseconds dtime)
 A method called after all entities that this system manage has been updated. More...
 
void update (std::chrono::nanoseconds dtime) final
 Update the whole system (every entities that this system is responsible can be updated. More...
 
void fixedUpdate () final
 An alternative of update that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up. More...
 
- Public Member Functions inherited from WAL::ISystem
virtual ~ISystem ()=default
 A virtual default destructor. More...
 

Protected Member Functions

 System (Wal &wal)
 A system can't be instantiated, it should be derived. More...
 
 System (const System &)=default
 A system can't be instantiated, it should be derived. More...
 
Systemoperator= (const System &)=default
 A system can't be instantiated, it should be derived. More...
 

Protected Attributes

Wal_wal
 A reference to the ECS. More...
 

Detailed Description

template<typename ... Dependencies>
class WAL::System< Dependencies >

A base system of WAL.

Template Parameters
DependenciesThe list of dependencies this system has.

Constructor & Destructor Documentation

◆ ~System()

template<typename ... Dependencies>
WAL::System< Dependencies >::~System ( )
overridedefault

A virtual, default, destructor.

◆ System() [1/3]

template<typename ... Dependencies>
WAL::System< Dependencies >::System ( System< Dependencies > &&  )
defaultnoexcept

A system can be moved.

◆ System() [2/3]

template<typename ... Dependencies>
WAL::System< Dependencies >::System ( Wal wal)
inlineexplicitprotected

A system can't be instantiated, it should be derived.

◆ System() [3/3]

template<typename ... Dependencies>
WAL::System< Dependencies >::System ( const System< Dependencies > &  )
protecteddefault

A system can't be instantiated, it should be derived.

Member Function Documentation

◆ fixedUpdate()

template<typename ... Dependencies>
void WAL::System< Dependencies >::fixedUpdate ( )
inlinefinalvirtual

An alternative of update that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up.

Remarks
This should be used for Physics, AI and everything that could be imprecise due to float rounding.

Implements WAL::ISystem.

◆ getView()

template<typename ... Dependencies>
View<Dependencies...>& WAL::System< Dependencies >::getView ( )
inlineoverridevirtual

Get a view of all entities containing every dependencies of this system.

Implements WAL::ISystem.

◆ onFixedUpdate()

template<typename ... Dependencies>
virtual void WAL::System< Dependencies >::onFixedUpdate ( ViewEntity< Dependencies... > &  entity)
inlinevirtual

An alternative of onUpdate that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up.

Remarks
This should be used for Physics, AI and everything that could be imprecise due to float rounding.
Parameters
entityThe entity to update.

◆ onSelfUpdate()

template<typename ... Dependencies>
virtual void WAL::System< Dependencies >::onSelfUpdate ( std::chrono::nanoseconds  dtime)
inlinevirtual

A method called after all entities that this system manage has been updated.

Parameters
dtimeThe delta time.

Reimplemented in BBM::RenderSystem, BBM::IAControllableSystem, BBM::LobbySystem, BBM::MenuControllableSystem, BBM::EventSystem, BBM::AnimationsSystem, BBM::ResumeLobbySystem, BBM::EndConditionSystem, and BBM::IntroAnimationSystem.

◆ onUpdate()

template<typename ... Dependencies>
virtual void WAL::System< Dependencies >::onUpdate ( ViewEntity< Dependencies... > &  entity,
std::chrono::nanoseconds  dtime 
)
inlinevirtual

Update the corresponding component of the given entity.

Parameters
entityThe entity to update.
dtimeThe delta time.

◆ operator=()

template<typename ... Dependencies>
System& WAL::System< Dependencies >::operator= ( const System< Dependencies > &  )
protecteddefault

A system can't be instantiated, it should be derived.

◆ update()

template<typename ... Dependencies>
void WAL::System< Dependencies >::update ( std::chrono::nanoseconds  dtime)
inlinefinalvirtual

Update the whole system (every entities that this system is responsible can be updated.

Parameters
dtimeThe delta time since the last call to this method.

Implements WAL::ISystem.

Member Data Documentation

◆ _wal

template<typename ... Dependencies>
Wal& WAL::System< Dependencies >::_wal
protected

A reference to the ECS.


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