|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBoard
public class Board
This class represents the board on which checkers is being played. The board holds a collection of pieces.
Field Summary | |
---|---|
static int |
KING
|
static int |
SINGLE
|
Constructor Summary | |
---|---|
Board()
This constructor creates a new board at the beginning of the game |
Method Summary | |
---|---|
java.util.Vector |
bluePieces()
This method returns a vector containing all blue Pieces |
java.awt.Color |
colorAt(int space)
This method returns the color of the piece at a certain space |
Piece |
getPieceAt(int space)
This method returns the piece at the certain position |
boolean |
hasPieceOf(java.awt.Color color)
This method returns if there is a piece of color on the board |
void |
kingPiece(int space)
This method creates a king piece |
int |
movePiece(int start,
int end)
Move the piece at the start position to the end position |
boolean |
occupied(int space)
This method checks if the space on the board contains a piece |
void |
removePiece(int space)
This method removes piece at the position space |
int |
sizeOf()
This method returns the size of the board |
java.util.Vector |
whitePieces()
This method returns a vector containing all white Pieces |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int SINGLE
public static int KING
Constructor Detail |
---|
public Board()
Method Detail |
---|
public int movePiece(int start, int end)
start
- - current location of the pieceend
- - the position where piece is moved
public boolean occupied(int space)
space
- - the space that needs to be checked
public void removePiece(int space)
space
- - the positon of the piece to be removedpublic void kingPiece(int space)
space
- - the psotion at which the king piece is createdpublic java.awt.Color colorAt(int space)
space
- - the position of the piece on the board
public Piece getPieceAt(int space)
space
- - the space of the piece
public boolean hasPieceOf(java.awt.Color color)
color
- - the color of the piece
public int sizeOf()
public java.util.Vector bluePieces()
public java.util.Vector whitePieces()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |