|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBoard
public class Board
Constructor Summary | |
---|---|
Board()
Constructor. |
Method Summary | |
---|---|
void |
addPiece(Piece p)
Add new piece on the board |
java.lang.String |
coordinatesToNotation(int x,
int y)
Forms notation from x and y. |
void |
emptyBoard()
Clear the board from pieces. |
Piece |
getPiece(int x,
int y,
int color)
Returns piece with given coordinates and color. |
java.util.ArrayList<Piece> |
getPieces()
Get all pieces as an arraylist. |
java.util.ArrayList<Piece> |
getPiecesFromOneSide(int color)
Get pieces from only one black or white as an arraylist. |
void |
loadGame()
Loads game state from a file. |
Index |
notationToIndex(java.lang.String notation)
Converts e.g. c5 to row4 col2 so that saves row and column number to Index object. |
Piece |
notationToPiece(java.lang.String notation)
Get piece based on notation. |
void |
promotePawnsToQueen(int color)
Promote all certain color pawns in enemy's end. |
void |
promotePiece(int x,
int y,
int type)
Promote piece with certain coordinates to certain type. |
void |
removePiece(int x,
int y)
Removes piece from the board. |
void |
removePiece(java.lang.String notation)
Removes piece from the board. |
void |
saveGame()
Saves game state to a file. |
void |
setPieces(java.util.ArrayList<Piece> pieces)
Set arraylist wich contains all pieces. |
void |
showGameState()
Shows the current game state which is 8x8 board with pieces on it. |
void |
showGameStateWithNotation()
Shows the current game state which is 8x8 board with pieces on it. |
void |
updateGameState()
Updates the current game state. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Board()
Method Detail |
---|
public void showGameState()
public void showGameStateWithNotation()
public java.lang.String coordinatesToNotation(int x, int y)
x
- y
-
public Index notationToIndex(java.lang.String notation)
notation
-
public Piece notationToPiece(java.lang.String notation)
notation
-
public void removePiece(int x, int y)
x
- y
- public void removePiece(java.lang.String notation)
notation
- public void addPiece(Piece p)
p
- public void emptyBoard()
public void saveGame()
public void loadGame()
public void updateGameState()
public java.util.ArrayList<Piece> getPieces()
public java.util.ArrayList<Piece> getPiecesFromOneSide(int color)
color
- public void setPieces(java.util.ArrayList<Piece> pieces)
pieces
- public void promotePiece(int x, int y, int type)
x
- y
- type
- public void promotePawnsToQueen(int color)
color
- public Piece getPiece(int x, int y, int color)
x
- y
- color
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |