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

The system that allow one to place bombs. More...

#include <BombHolderSystem.hpp>

Inheritance diagram for BBM::BombHolderSystem:
Collaboration diagram for BBM::BombHolderSystem:

Public Member Functions

void onUpdate (WAL::ViewEntity< PositionComponent, BombHolderComponent, ControllableComponent > &entity, std::chrono::nanoseconds dtime) override
 
 BombHolderSystem (WAL::Wal &wal)
 A default constructor. More...
 
 BombHolderSystem (const BombHolderSystem &)=default
 A bomb holder system is copy constructable. More...
 
 ~BombHolderSystem () override=default
 A default destructor. More...
 
BombHolderSystemoperator= (const BombHolderSystem &)=delete
 A bomb holder system is not assignable. More...
 
- Public Member Functions inherited from WAL::System< PositionComponent, BombHolderComponent, ControllableComponent >
 ~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...
 

Static Public Attributes

static std::chrono::nanoseconds explosionTimer = 2s
 The explosion time of new bombs. More...
 

Private Member Functions

void _spawnBomb (Vector3f position, BombHolderComponent &holder)
 Spawn a bomb at the specified position. More...
 

Static Private Member Functions

static void _dispatchExplosion (const Vector3f &position, WAL::Wal &wal, int size, ExpansionDirection expansionDirections=ExpansionDirection::DOWN|ExpansionDirection::UP|ExpansionDirection::FRONT|ExpansionDirection::BACK|ExpansionDirection::LEFT|ExpansionDirection::RIGHT)
 Spawn a bomb at the specified position. More...
 
static void _bombExplosion (WAL::Entity &bomb, WAL::Wal &)
 The method triggered when the bomb explode. More...
 
static void _bombCollide (WAL::Entity &entity, const WAL::Entity &wall, BBM::CollisionComponent::CollidedAxis collidedAxis)
 The method called when a player collide with a bomb. More...
 

Additional Inherited Members

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

Detailed Description

The system that allow one to place bombs.

Constructor & Destructor Documentation

◆ BombHolderSystem() [1/2]

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

A default constructor.

◆ BombHolderSystem() [2/2]

BBM::BombHolderSystem::BombHolderSystem ( const BombHolderSystem )
default

A bomb holder system is copy constructable.

◆ ~BombHolderSystem()

BBM::BombHolderSystem::~BombHolderSystem ( )
overridedefault

A default destructor.

Member Function Documentation

◆ _bombCollide()

void BBM::BombHolderSystem::_bombCollide ( WAL::Entity entity,
const WAL::Entity wall,
BBM::CollisionComponent::CollidedAxis  collidedAxis 
)
staticprivate

The method called when a player collide with a bomb.

◆ _bombExplosion()

void BBM::BombHolderSystem::_bombExplosion ( WAL::Entity bomb,
WAL::Wal wal 
)
staticprivate

The method triggered when the bomb explode.

◆ _dispatchExplosion()

void BBM::BombHolderSystem::_dispatchExplosion ( const Vector3f position,
WAL::Wal wal,
int  size,
ExpansionDirection  expansionDirections = ExpansionDirection::DOWN | ExpansionDirection::UP | ExpansionDirection::FRONT | ExpansionDirection::BACK | ExpansionDirection::LEFT | ExpansionDirection::RIGHT 
)
staticprivate

Spawn a bomb at the specified position.

◆ _spawnBomb()

void BBM::BombHolderSystem::_spawnBomb ( Vector3f  position,
BombHolderComponent holder 
)
private

Spawn a bomb at the specified position.

◆ onUpdate()

void BBM::BombHolderSystem::onUpdate ( WAL::ViewEntity< PositionComponent, BombHolderComponent, ControllableComponent > &  entity,
std::chrono::nanoseconds  dtime 
)
override

◆ operator=()

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

A bomb holder system is not assignable.

Member Data Documentation

◆ explosionTimer

std::chrono::nanoseconds BBM::BombHolderSystem::explosionTimer = 2s
static

The explosion time of new bombs.


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