-
Notifications
You must be signed in to change notification settings - Fork 0
/
IChessModel.java
65 lines (52 loc) · 2.27 KB
/
IChessModel.java
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
60
61
62
63
64
/****************************************************************************************************************************************************
* @Author: Corey M. Moura
* @Date: March 1, 2018
* @Professor: Dr. Trafftz
* @Project: Project 3 of CS163: Chess Game, player vs computer
* @Notes:
*
*
/****************************************************************************************************************************************************/
public interface IChessModel
{
/**
* Returns whether the game is complete.
*
* @return {@code true} if complete, {@code false} otherwise.
*/
boolean isComplete();
/**
* Returns whether the piece at location {@code [move.fromRow, move.fromColumn]} is allowed to move to location
* {@code [move.fromRow, move.fromColumn]}.
*
* @param move a {@link W18project3.Move} object describing the move to be made.
* @return {@code true} if the proposed move is valid, {@code false} otherwise.
* @throws IndexOutOfBoundsException if either {@code [move.fromRow, move.fromColumn]} or {@code [move.toRow,
* move.toColumn]} don't represent valid locations on the board.
*/
//boolean isValidMove(Move move);
/**
* Moves the piece from location {@code [move.fromRow, move.fromColumn]} to location {@code [move.fromRow,
* move.fromColumn]}.
*
* @param move a {@link W18project3.Move} object describing the move to be made.
* @throws IndexOutOfBoundsException if either {@code [move.fromRow, move.fromColumn]} or {@code [move.toRow,
* move.toColumn]} don't represent valid locations on the board.
*/
void move(Move move);
/**
* Report whether the current player p is in check.
* @param p {@link W18project3.Move} the Player being checked
* @return {@code true} if the current player is in check, {@code false} otherwise.
*/
boolean inCheck(Player p);
/**
* Return the current player.
*
* @return the current player
*/
Player currentPlayer();
int numRows() ;
int numColumns();
public IChessPiece pieceAt(int row, int column);
}