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