-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
39 lines (30 loc) · 1.07 KB
/
Player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef PLAYER_H
#define PLAYER_H
#include "ChessPiece.h"
#include "Game.h"
enum PlayerType
{
PLAYER_TYPE_HUMAN = 0, // Tah zadává na desce hráč
PLAYER_TYPE_COMPUTER = 1 // Tah vypočítá AI
};
class Player
{
public:
Player();
~Player();
void SetPlayerType(PlayerType playerType) { _playerType = playerType; }
PlayerType GetPlayerType() { return _playerType; }
void SetPlayerColor(PieceColor color) { _color = color; }
PieceColor GetPlayerColor() { return _color; }
void SetGameDifficulty(GameDifficulty difficulty) { _difficulty = difficulty; }
GameDifficulty GetGameDifficulty() { return _difficulty; }
bool IsWhite() { return _color == PIECE_COLOR_WHITE; }
bool IsBlack() { return _color == PIECE_COLOR_BLACK; }
bool IsHuman() { return _playerType == PLAYER_TYPE_HUMAN; }
bool IsComputer() { return _playerType == PLAYER_TYPE_COMPUTER; }
private:
PlayerType _playerType;
PieceColor _color;
GameDifficulty _difficulty;
};
#endif // PLAYER_H