Bomberman
LobbyComponent.hpp
Go to the documentation of this file.
1 //
2 // Created by Zoe Roux on 6/11/21.
3 //
4 
5 #pragma once
6 
8 #include <Entity/Entity.hpp>
9 #include <Color.hpp>
11 #include <chrono>
12 
13 namespace BBM
14 {
16  {
17  public:
21  int playerID;
23  int color;
25  bool ready = false;
31  std::chrono::time_point<std::chrono::steady_clock> lastInput;
32 
33  Component *clone(WAL::Entity &entity) const override;
34 
36  explicit LobbyComponent(WAL::Entity &entity, int playerNumber, WAL::Entity &button, WAL::Entity &tile);
38  LobbyComponent(const LobbyComponent &) = default;
40  ~LobbyComponent() override = default;
42  LobbyComponent &operator=(const LobbyComponent &) = delete;
43  };
44 }
BBM::LobbyComponent::ready
bool ready
Is this player ready.
Definition: LobbyComponent.hpp:25
BBM::LobbyComponent::clone
Component * clone(WAL::Entity &entity) const override
Clone a component for another or the same entity.
Definition: LobbyComponent.cpp:16
BBM::ControllableComponent::Layout
Layout
Definition: ControllableComponent.hpp:20
WAL::Component
Represent a single component of WAL.
Definition: Component.hpp:17
BBM
Definition: AnimationsComponent.cpp:9
Entity.hpp
WAL::Entity
An entity of the WAL's ECS.
Definition: Entity.hpp:20
ControllableComponent.hpp
BBM::LobbyComponent::LobbyComponent
LobbyComponent(WAL::Entity &entity, int playerNumber, WAL::Entity &button, WAL::Entity &tile)
Create a new lobby component.
Definition: LobbyComponent.cpp:9
Component.hpp
BBM::LobbyComponent::operator=
LobbyComponent & operator=(const LobbyComponent &)=delete
A lobby component is not assignable.
WAL::Component::Component
Component(Entity &entity)
A component can't be instantiated, it should be derived.
Definition: Component.cpp:9
BBM::LobbyComponent::~LobbyComponent
~LobbyComponent() override=default
A default destructor.
BBM::LobbyComponent::layout
ControllableComponent::Layout layout
The layout used for this player.
Definition: LobbyComponent.hpp:19
BBM::LobbyComponent::color
int color
The color of the player (as an index)
Definition: LobbyComponent.hpp:23
BBM::ControllableComponent::NONE
@ NONE
Definition: ControllableComponent.hpp:22
Color.hpp
BBM::LobbyComponent::playerID
int playerID
The ID of the lobby player (from 0 to 3)
Definition: LobbyComponent.hpp:21
BBM::LobbyComponent::readyButton
WAL::Entity & readyButton
The entity containing the ready display.
Definition: LobbyComponent.hpp:27
BBM::LobbyComponent
Definition: LobbyComponent.hpp:15
BBM::LobbyComponent::lastInput
std::chrono::time_point< std::chrono::steady_clock > lastInput
The time of last input that this lobby player has made.
Definition: LobbyComponent.hpp:31
BBM::LobbyComponent::coloredTile
WAL::Entity & coloredTile
The colored rectangle behind the player.
Definition: LobbyComponent.hpp:29