-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPieces.cpp
More file actions
53 lines (47 loc) · 807 Bytes
/
Pieces.cpp
File metadata and controls
53 lines (47 loc) · 807 Bytes
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
#include <iostream>
#include <fstream>
#include <vector>
#include "Pieces.h"
#include "Board.h"
#include <string>
using namespace std;
//This gives them default values
Pieces::Pieces()
{
PType = "";
PColor = "";
PRow = 0;
PCol = 0;
}
//This assigns the pieces a specific datamember at the start as they won't have to change
Pieces::Pieces(string type, string color, int row, int col)
{
PType = type;
PColor = color;
PRow = row;
PCol = col;
}
Pieces::~Pieces()
{
}
//These return the data members so other classes can use them
string Pieces::getType()
{
return PType;
}
void Pieces::changeColor(string color)
{
PColor = color;
}
string Pieces::getColor()
{
return PColor;
}
int Pieces::getRow()
{
return PRow;
}
int Pieces::getCol()
{
return PCol;
}