Bomberman
sources
System
MenuControllable
MenuControllableSystem.hpp
Go to the documentation of this file.
1
//
2
// Created by Louis Auzuret on 06/03/21
3
//
4
5
#pragma once
6
7
#include "
Component/Controllable/ControllableComponent.hpp
"
8
#include "
Models/Vector2.hpp
"
9
#include "
System/System.hpp
"
10
#include "
Component/Position/PositionComponent.hpp
"
11
#include "
Component/Renderer/Drawable2DComponent.hpp
"
12
#include "
Component/Button/ButtonComponent.hpp
"
13
14
namespace
BBM
15
{
17
class
MenuControllableSystem
:
public
WAL::System
<>
18
{
19
private
:
21
Vector2f
_oldMousePosition
;
22
25
void
_updateCurrentButton
(
bool
selected,
Vector2f
move);
26
28
bool
_mouseOnButton
(
const
Vector2f
&mousePos,
WAL::ViewEntity<OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent>
&entity)
const
;
29
public
:
31
WAL::Entity
*
currentButton
;
32
34
std::chrono::time_point<std::chrono::steady_clock>
now
;
36
void
onSelfUpdate
(std::chrono::nanoseconds dtime)
override
;
37
39
explicit
MenuControllableSystem
(
WAL::Wal
&wal);
41
MenuControllableSystem
(
const
MenuControllableSystem
&) =
delete
;
43
~MenuControllableSystem
()
override
=
default
;
45
MenuControllableSystem
&
operator=
(
const
MenuControllableSystem
&) =
delete
;
46
};
47
}
BBM::Vector2< float >
BBM::MenuControllableSystem::~MenuControllableSystem
~MenuControllableSystem() override=default
A default destructor.
WAL::ViewEntity
Definition:
View.hpp:19
System.hpp
BBM::MenuControllableSystem
A system to handle Controllable entities in a menu.
Definition:
MenuControllableSystem.hpp:17
BBM::MenuControllableSystem::now
std::chrono::time_point< std::chrono::steady_clock > now
time (in millisecond) since last check
Definition:
MenuControllableSystem.hpp:34
Vector2.hpp
BBM::MenuControllableSystem::_oldMousePosition
Vector2f _oldMousePosition
position of the mouse at the precedent scene (to know which controller event to watch)
Definition:
MenuControllableSystem.hpp:21
BBM
Definition:
AnimationsComponent.cpp:9
PositionComponent.hpp
WAL::Wal
The main WAL class, it is used to setup and run the ECS.
Definition:
Wal.hpp:27
WAL::Entity
An entity of the WAL's ECS.
Definition:
Entity.hpp:20
BBM::MenuControllableSystem::_updateCurrentButton
void _updateCurrentButton(bool selected, Vector2f move)
update current button reference
Definition:
MenuControllableSystem.cpp:26
BBM::MenuControllableSystem::onSelfUpdate
void onSelfUpdate(std::chrono::nanoseconds dtime) override
A method called after all entities that this system manage has been updated.
Definition:
MenuControllableSystem.cpp:76
ControllableComponent.hpp
BBM::MenuControllableSystem::MenuControllableSystem
MenuControllableSystem(WAL::Wal &wal)
A default constructor.
Definition:
MenuControllableSystem.cpp:19
WAL::System
A base system of WAL.
Definition:
System.hpp:22
Drawable2DComponent.hpp
ButtonComponent.hpp
BBM::MenuControllableSystem::currentButton
WAL::Entity * currentButton
index of the current button selected
Definition:
MenuControllableSystem.hpp:31
BBM::MenuControllableSystem::operator=
MenuControllableSystem & operator=(const MenuControllableSystem &)=delete
A MenuControllable system is not assignable.
BBM::MenuControllableSystem::_mouseOnButton
bool _mouseOnButton(const Vector2f &mousePos, WAL::ViewEntity< OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent > &entity) const
Definition:
MenuControllableSystem.cpp:56
Generated by
1.8.17