parent
88a5ded3f6
commit
5dcff17a02
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
//Main class and GUI
|
||||||
|
|
||||||
|
public class Chess {
|
||||||
|
private GameBoard board;
|
||||||
|
//Remembers the initial click square for the user's move
|
||||||
|
//Stack of GameBoard states for the move undo.
|
||||||
|
//Stack of tuples (moves) so they can be displayed.
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
//Set up the initial board
|
||||||
|
}
|
||||||
|
|
||||||
|
//Reset to the intial game position.
|
||||||
|
public void reset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
//AI makes a move
|
||||||
|
public void moveAI() {
|
||||||
|
}
|
||||||
|
|
||||||
|
//For the human moving
|
||||||
|
public void mouseClick() {
|
||||||
|
}
|
||||||
|
|
||||||
|
//Undo button for the most recent move
|
||||||
|
public void undo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
public class GameState {
|
||||||
|
//Tracks the game board as a 1D array of Square objects (effectively 12 x 12) with 2 layers of sentinel squares all around.
|
||||||
|
//Knows whose turn it is
|
||||||
|
|
||||||
|
public GameState() {
|
||||||
|
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void attemptMove(int sourceX, int sourceY, int destX, int destY) {
|
||||||
|
//See if it is legal.
|
||||||
|
//Change the board state accordingly.
|
||||||
|
}
|
||||||
|
|
||||||
|
public Moves[] getAllPossibleMoves() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// returns something like "checkmate", "stalemate", etc.
|
||||||
|
public String getFeedback() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
public class Move {
|
||||||
|
//source and dest coordinates
|
||||||
|
//boolean check or not
|
||||||
|
//boolean capture or not
|
||||||
|
//boolean checkmate or not
|
||||||
|
|
||||||
|
|
||||||
|
//returns something like e2-e4 or Qc8++
|
||||||
|
public String toString() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
public class Square {
|
||||||
|
//Pawn, knight, bishop, rook, queen, king, blank.
|
||||||
|
//White or black boolean
|
||||||
|
//en passant boolean flag (for the square that would be "captured")
|
||||||
|
//boolean Knowledge of whether or not this piece moved yet (for castling)
|
||||||
|
//boolean for off-the-board square
|
||||||
|
|
||||||
|
//Positive values for white, negative for black, blank square is 0.
|
||||||
|
public int getValue() {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue