A class that represents a player in the game.
More...
#include <Player.hpp>
|
| enum class | PlayerState { NORMAL
, JETPACK
, ZAPPED
, FIRED
} |
| |
|
| | Player (std::size_t id, sf::Vector2u textureSize) |
| | Constructor for Player class.
|
| |
|
| ~Player () |
| | Destructor for Player class.
|
| |
| | Player (const Player &)=delete |
| | Deleted copy constructor.
|
| |
| Player & | operator= (const Player &)=delete |
| | Deleted assignment operator.
|
| |
| const std::size_t & | getId () const |
| | Gets the ID of the player.
|
| |
| const std::string & | getPseudo () const |
| | Gets the pseudo of the player.
|
| |
| void | setPseudo (const std::string &pseudo) |
| | Sets the pseudo of the player.
|
| |
| const bool & | isAlive () const |
| | Gets the alive status of the player.
|
| |
| void | setAlive (bool alive) |
| | Sets the alive status of the player.
|
| |
| const bool & | isVisible () const |
| | Gets the visible status of the player.
|
| |
| void | setVisible (bool visible) |
| | Sets the visible status of the player.
|
| |
| const std::size_t & | getScore () const |
| | Gets the score of the player.
|
| |
| void | setScore (std::size_t score) |
| | Sets the score of the player.
|
| |
| const std::array< float, 2 > & | getPosition () const |
| | Gets the position of the player.
|
| |
| void | setPosition (const std::array< float, 2 > &position) |
| | Sets the position of the player.
|
| |
| Animation & | getAnimation () |
| | Gets the animation of the player.
|
| |
| const PlayerState & | getPlayerState () const |
| | Gets the state of the player.
|
| |
| void | setPlayerState (PlayerState playerState) |
| | Sets the state of the player.
|
| |
|
|
std::size_t | _id |
| |
|
std::string | _pseudo |
| |
|
bool | _alive = true |
| |
|
bool | _visible = true |
| |
|
std::size_t | _score = 0 |
| |
|
std::array< float, 2 > | _position = {0, 0} |
| |
|
Animation | _animation |
| |
|
PlayerState | _player_state = PlayerState::NORMAL |
| |
A class that represents a player in the game.
◆ Player() [1/2]
| Player |
( |
std::size_t | id, |
|
|
sf::Vector2u | textureSize ) |
Constructor for Player class.
- Parameters
-
| id | The ID of the player |
| textureSize | The size of the texture |
◆ Player() [2/2]
Deleted copy constructor.
- Parameters
-
| other | The Player object to copy from |
◆ getAnimation()
Gets the animation of the player.
- Returns
- The animation of the player
◆ getId()
| const std::size_t & getId |
( |
| ) |
const |
Gets the ID of the player.
- Returns
- The ID of the player
◆ getPlayerState()
| const Player::PlayerState & getPlayerState |
( |
| ) |
const |
Gets the state of the player.
- Returns
- The state of the player
◆ getPosition()
| const std::array< float, 2 > & getPosition |
( |
| ) |
const |
Gets the position of the player.
- Returns
- The position of the player
◆ getPseudo()
| const std::string & getPseudo |
( |
| ) |
const |
Gets the pseudo of the player.
- Returns
- The pseudo of the player
◆ getScore()
| const std::size_t & getScore |
( |
| ) |
const |
Gets the score of the player.
- Returns
- The score of the player
◆ isAlive()
| const bool & isAlive |
( |
| ) |
const |
Gets the alive status of the player.
- Returns
- The alive status of the player
◆ isVisible()
| const bool & isVisible |
( |
| ) |
const |
Gets the visible status of the player.
- Returns
- The visible status of the player
◆ operator=()
Deleted assignment operator.
- Parameters
-
| other | The Player object to assign from |
- Returns
- Reference to the current object
◆ setAlive()
| void setAlive |
( |
bool | alive | ) |
|
Sets the alive status of the player.
- Parameters
-
| alive | The alive status of the player |
◆ setPlayerState()
| void setPlayerState |
( |
PlayerState | playerState | ) |
|
Sets the state of the player.
- Note
- This function changes the animation of the player
- Parameters
-
| playerState | The state of the player |
| playerState | The state of the player |
◆ setPosition()
| void setPosition |
( |
const std::array< float, 2 > & | position | ) |
|
Sets the position of the player.
- Parameters
-
| position | The position of the player |
◆ setPseudo()
| void setPseudo |
( |
const std::string & | pseudo | ) |
|
Sets the pseudo of the player.
- Parameters
-
| pseudo | The pseudo of the player |
◆ setScore()
| void setScore |
( |
std::size_t | score | ) |
|
Sets the score of the player.
- Parameters
-
| score | The score of the player |
◆ setVisible()
| void setVisible |
( |
bool | visible | ) |
|
Sets the visible status of the player.
- Parameters
-
| visible | The visible status of the player |
The documentation for this class was generated from the following files: