-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayGame.java
More file actions
34 lines (31 loc) · 797 Bytes
/
Copy pathplayGame.java
File metadata and controls
34 lines (31 loc) · 797 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
package com.Game.chess;
import org.springframework.stereotype.Component;
import java.util.*;
@Component
public class playGame {
Board board;
public playGame(){
buildBoard();
}
public void buildBoard(){
board = new Board();
board.setRooks();
board.setKnights();
board.setBishops();
board.setQueens();
board.setKings();
board.setPawns();
}
public String getPiece(int r, int c){
return board.getPieceName(r, c);
}
public List<List<Integer>> activateValidMoves(int row, int col){
return board.activeCells(row, col);
}
public void playMove(int r1, int c1, int r2, int c2){
board.MovePiece(r1, c1, r2, c2);
}
public void resetGame(){
buildBoard();
}
}