mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-27 16:22:09 +00:00
mosue management
This commit is contained in:
@@ -7,11 +7,14 @@
|
||||
#include "Component/Controllable/ControllableComponent.hpp"
|
||||
#include "Models/Vector2.hpp"
|
||||
#include "System/System.hpp"
|
||||
#include "Component/Position/PositionComponent.hpp"
|
||||
#include "Component/Renderer/Drawable2DComponent.hpp"
|
||||
#include "Component/Button/ButtonComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
//! @brief A system to handle Controllable entities in a menu.
|
||||
class MenuControllableSystem : public WAL::System<ControllableComponent>
|
||||
class MenuControllableSystem : public WAL::System<>
|
||||
{
|
||||
private:
|
||||
//! @brief index of the current button selected
|
||||
@@ -21,11 +24,13 @@ namespace BBM
|
||||
//! @param selected lets know if te new selected button is 'pressed'
|
||||
void _updateCurrentButton(bool selected, Vector2f move);
|
||||
|
||||
//! @return true if mouse on entity
|
||||
bool _mouseOnButton(WAL::ViewEntity<OnClickComponent, OnHoverComponent, OnIdleComponent, PositionComponent, Drawable2DComponent> &entity) const;
|
||||
public:
|
||||
//! @brief time (in millisecond) since last check
|
||||
std::chrono::time_point<std::chrono::steady_clock> now;
|
||||
//! @inherit
|
||||
void onFixedUpdate(WAL::ViewEntity<ControllableComponent> &entities) override;
|
||||
void onSelfUpdate() override;
|
||||
|
||||
//! @brief A default constructor
|
||||
explicit MenuControllableSystem(WAL::Wal &wal);
|
||||
|
||||
Reference in New Issue
Block a user