-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScoreBoard.cpp
More file actions
96 lines (93 loc) · 2.67 KB
/
ScoreBoard.cpp
File metadata and controls
96 lines (93 loc) · 2.67 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include <string>
#include <iostream>
#include <vector>
#include "ScoreBoard.h"
using namespace std;
//This initializes everything at the start
ScoreBoard::ScoreBoard()
{
numPawn = 0;
numBishop = 0;
numKnight = 0;
numRook = 0;
numQueen = 0;
numKing = 0;
numPawn1 = 0;
numBishop1 = 0;
numKnight1 = 0;
numRook1 = 0;
numQueen1 = 0;
numKing1 = 0;
}
ScoreBoard::~ScoreBoard()
{
}
//This will find all the number of pieces that player 1 has taken with a for loop through the tile board
void ScoreBoard::getNumPlayer1()
{
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
/* if (tileBoard[i][j].getType == "Pawn" && tileBoard[i][j].getColor == "Black")
{
numPawn++;
}
else if (tileBoard[i][j].getType == "Bishop" && tileBoard[i][j].getColor == "Black")
{
numBishop++;
}
else if (tileBoard[i][j].getType == "Knight" && tileBoard[i][j].getColor == "Black")
{
numBishop++;
}
else if (tileBoard[i][j].getType == "Rook" && tileBoard[i][j].getColor == "Black")
{
numKnight++;
}
else if (tileBoard[i][j].getType == "Queen" && tileBoard[i][j].getColor == "Black")
{
numQueen++;
}
else if (tileBoard[i][j].getType == "King" && tileBoard[i][j].getColor == "Black")
{
numKing++;
}
*/
}
}
}
//This will find all the number of pieces that player 2 has taken with a for loop through the tile board
void ScoreBoard::getNumPlayer2()
{
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
/* if (tileBoard[i][j].getType == "Pawn" && tileBoard[i][j].getColor == "White")
{
numPawn1++;
}
else if (tileBoard[i][j].getType == "Bishop" && tileBoard[i][j].getColor == "White")
{
numBishop1++;
}
else if (tileBoard[i][j].getType == "Knight" && tileBoard[i][j].getColor == "White")
{
numBishop1++;
}
else if (tileBoard[i][j].getType == "Rook" && tileBoard[i][j].getColor == "White")
{
numKnight1++;
}
else if (tileBoard[i][j].getType == "Queen" && tileBoard[i][j].getColor == "White")
{
numQueen1++;
}
else if (tileBoard[i][j].getType == "King" && tileBoard[i][j].getColor == "White")
{
numKing1++;
}*/
}
}
}