-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWhiteChessPlayer.cpp
More file actions
60 lines (48 loc) · 1.17 KB
/
Copy pathWhiteChessPlayer.cpp
File metadata and controls
60 lines (48 loc) · 1.17 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
#include "WhiteChessPlayer.h"
#include "Pawn.h"
#include "Rook.h"
#include "King.h"
#include "Queen.h"
#include "Bishop.h"
#include "Knight.h"
WhiteChessPlayer::WhiteChessPlayer()
{
InitializeWhitePieces();
}
WhiteChessPlayer::~WhiteChessPlayer()
{
//dtor
}
void WhiteChessPlayer::InitializeWhitePieces(){
for (int i = 0; i < 8; i++){
ChessPiece* pawn = new Pawn(i,1, "White");
m_availablePieces['p'].push_back(pawn);
}
for (int i = 0; i < 8; i++){
ChessPiece* addToBoard = PieceIndex(i);
m_availablePieces[addToBoard->GetSymbol()].push_back(addToBoard);
}
}
ChessPiece* WhiteChessPlayer::PieceIndex(int j){
if(j == 0 || j== 7){
return new Rook(j, 0, "White");
}
if(j == 1 || j== 6){
return new Knight(j, 0,"White");
}
if(j == 2 || j== 5){
return new Bishop(j, 0, "White");
}
if(j == 3){
return new Queen(j, 0,"White");
}
if(j == 4){
return new King(j,0, "White");
}
return new Pawn(j,0, "White");
}
position_t* WhiteChessPlayer::GetAvailableMoves(int x, int y, char cell){
return 0;
}
void WhiteChessPlayer::MoveSelectedPiece(int x, int y){
}