-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.h
More file actions
executable file
·46 lines (42 loc) · 1.42 KB
/
Copy pathPlayer.h
File metadata and controls
executable file
·46 lines (42 loc) · 1.42 KB
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
40
41
42
43
44
45
46
#ifndef PLAYER_H
#define PLAYER_H
#include <string>
#include <vector>
#include "Mosaic.h"
class Player
{
public:
//New player
Player(std::string name);
//Player from save
Player(std::string name, int score, Mosaic *mosaic);
~Player();
//Return name
std::string getName();
//Return score
int getScore();
//Move tiles to wall, calc score, return tiles for lid
std::vector<TileType> calcScore();
//Return pointer to mosaic
Mosaic *getMosaic();
//Check whether horizontal row in wall is full
bool hasWon();
//Check whether a player has the FP tile
bool hasFirstPlayer();
private:
//Helper to score single line
int scoreLine(int lineNum);
//Calculate score for a row
int calcRow(int index, int line);
//Calculate score for a column
int calcCol(int index, int line);
std::string name;
int score;
Mosaic *mosaic;
TileType master_wall[NUMBER_OF_LINES][NUMBER_OF_LINES] = {DARKBLUE, YELLOW, RED, BLACK, LIGTHBLUE,
LIGTHBLUE, DARKBLUE, YELLOW, RED, BLACK,
BLACK, LIGTHBLUE, DARKBLUE, YELLOW, RED,
RED, BLACK, LIGTHBLUE, DARKBLUE, YELLOW,
YELLOW, RED, BLACK, LIGTHBLUE, DARKBLUE};
};
#endif // !PLAYER_H