16 #include "client/Animation.hpp"
33 Player(std::size_t
id, sf::Vector2u textureSize);
53 enum class PlayerState {
68 const std::size_t &
getId()
const;
78 void setPseudo(
const std::string &pseudo);
103 const std::size_t &
getScore()
const;
118 void setPosition(
const std::array<float, 2> &position);
142 bool _visible =
true;
143 std::size_t _score = 0;
144 std::array<float, 2> _position = {0, 0};
145 Animation _animation;
146 PlayerState _player_state = PlayerState::NORMAL;
A class that handles sprite animations.
Definition Animation.hpp:27
A class that represents a player in the game.
Definition Player.hpp:24
~Player()
Destructor for Player class.
Definition Player.cpp:36
const std::size_t & getScore() const
Gets the score of the player.
Definition Player.cpp:108
void setVisible(bool visible)
Sets the visible status of the player.
Definition Player.cpp:99
const bool & isVisible() const
Gets the visible status of the player.
Definition Player.cpp:90
void setPseudo(const std::string &pseudo)
Sets the pseudo of the player.
Definition Player.cpp:63
const std::string & getPseudo() const
Gets the pseudo of the player.
Definition Player.cpp:54
void setAlive(bool alive)
Sets the alive status of the player.
Definition Player.cpp:81
Player & operator=(const Player &)=delete
Deleted assignment operator.
void setPlayerState(PlayerState playerState)
Sets the state of the player.
Definition Player.cpp:162
void setPosition(const std::array< float, 2 > &position)
Sets the position of the player.
Definition Player.cpp:135
Player(std::size_t id, sf::Vector2u textureSize)
Constructor for Player class.
Definition Player.cpp:21
void setScore(std::size_t score)
Sets the score of the player.
Definition Player.cpp:117
Animation & getAnimation()
Gets the animation of the player.
Definition Player.cpp:144
const bool & isAlive() const
Gets the alive status of the player.
Definition Player.cpp:72
const std::size_t & getId() const
Gets the ID of the player.
Definition Player.cpp:45
Player(const Player &)=delete
Deleted copy constructor.
const std::array< float, 2 > & getPosition() const
Gets the position of the player.
Definition Player.cpp:126
const PlayerState & getPlayerState() const
Gets the state of the player.
Definition Player.cpp:153