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

A system to handle Controllable entities in a menu. More...

#include <MenuControllableSystem.hpp>

Inheritance diagram for BBM::MenuControllableSystem:
Collaboration diagram for BBM::MenuControllableSystem:

Public Member Functions

void onSelfUpdate (std::chrono::nanoseconds dtime) override
 A method called after all entities that this system manage has been updated. More...
 
 MenuControllableSystem (WAL::Wal &wal)
 A default constructor. More...
 
 MenuControllableSystem (const MenuControllableSystem &)=delete
 A MenuControllable system is not copy constructable. More...
 
 ~MenuControllableSystem () override=default
 A default destructor. More...
 
MenuControllableSystemoperator= (const MenuControllableSystem &)=delete
 A MenuControllable system is not assignable. More...
 
- Public Member Functions inherited from WAL::System<>
 ~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...
 
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...
 

Public Attributes

WAL::EntitycurrentButton
 index of the current button selected More...
 
std::chrono::time_point< std::chrono::steady_clock > now
 time (in millisecond) since last check More...
 

Private Member Functions

void _updateCurrentButton (bool selected, Vector2f move)
 update current button reference More...
 
bool _mouseOnButton (const Vector2f &mousePos, WAL::ViewEntity< OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent > &entity) const
 

Private Attributes

Vector2f _oldMousePosition
 position of the mouse at the precedent scene (to know which controller event to watch) More...
 

Additional Inherited Members

- Protected Member Functions inherited from WAL::System<>
 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 inherited from WAL::System<>
Wal_wal
 A reference to the ECS. More...
 

Detailed Description

A system to handle Controllable entities in a menu.

Constructor & Destructor Documentation

◆ MenuControllableSystem() [1/2]

BBM::MenuControllableSystem::MenuControllableSystem ( WAL::Wal wal)
explicit

A default constructor.

◆ MenuControllableSystem() [2/2]

BBM::MenuControllableSystem::MenuControllableSystem ( const MenuControllableSystem )
delete

A MenuControllable system is not copy constructable.

◆ ~MenuControllableSystem()

BBM::MenuControllableSystem::~MenuControllableSystem ( )
overridedefault

A default destructor.

Member Function Documentation

◆ _mouseOnButton()

bool BBM::MenuControllableSystem::_mouseOnButton ( const Vector2f mousePos,
WAL::ViewEntity< OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent > &  entity 
) const
private
Returns
true if mouse on entity

◆ _updateCurrentButton()

void BBM::MenuControllableSystem::_updateCurrentButton ( bool  selected,
Vector2f  move 
)
private

update current button reference

Parameters
selectedlets know if te new selected button is 'pressed'

◆ onSelfUpdate()

void BBM::MenuControllableSystem::onSelfUpdate ( std::chrono::nanoseconds  dtime)
overridevirtual

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

Parameters
dtimeThe delta time.

Reimplemented from WAL::System<>.

◆ operator=()

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

A MenuControllable system is not assignable.

Member Data Documentation

◆ _oldMousePosition

Vector2f BBM::MenuControllableSystem::_oldMousePosition
private

position of the mouse at the precedent scene (to know which controller event to watch)

◆ currentButton

WAL::Entity* BBM::MenuControllableSystem::currentButton

index of the current button selected

◆ now

std::chrono::time_point<std::chrono::steady_clock> BBM::MenuControllableSystem::now

time (in millisecond) since last check


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