My Project
UML Lab
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
Player Class Reference

Class representing a player in the game. More...

#include <player.h>

Public Types

enum class  PlayerType { Human , Computer }
 Enumeration representing the type of player. More...
 

Public Member Functions

 Player (const sf::Color color)
 Constructor for Player class with default type as Human.
 
 Player (sf::Color color, PlayerType type)
 Constructor for Player class.
 
sf::Color getColor () const
 Getter function for the color of the player.
 

Public Attributes

PlayerType type
 

Private Attributes

sf::Color color
 

Friends

class Board
 

Detailed Description

Class representing a player in the game.

Member Enumeration Documentation

◆ PlayerType

enum class Player::PlayerType
strong

Enumeration representing the type of player.

Enumerator
Human 

Human player

Computer 

Computer player

Constructor & Destructor Documentation

◆ Player() [1/2]

Player::Player ( const sf::Color color)

Constructor for Player class with default type as Human.

Parameters
colorThe color of the player.

◆ Player() [2/2]

Player::Player ( sf::Color color,
PlayerType type )

Constructor for Player class.

Parameters
colorThe color of the player.
typeThe type of the player.

Member Function Documentation

◆ getColor()

sf::Color Player::getColor ( ) const
inline

Getter function for the color of the player.

Returns
The color of the player.

Friends And Related Symbol Documentation

◆ Board

friend class Board
friend

Member Data Documentation

◆ color

sf::Color Player::color
private

The color of the player. The type of the player.

◆ type

PlayerType Player::type

The documentation for this class was generated from the following files: