net.sourceforge.simplegamenet.chess
Class ChessPlayField

java.lang.Object
  extended bynet.sourceforge.simplegamenet.chess.ChessPlayField
All Implemented Interfaces:
ChessGridSize, ChessPieceOwner, ChessPieceType, ChessPlayFieldState, Serializable

public class ChessPlayField
extends Object
implements ChessGridSize, ChessPlayFieldState, ChessPieceType, ChessPieceOwner, Serializable

See Also:
Serialized Form

Field Summary
static int[][] DEFAULT_PIECE_OWNER_GRID
           
static int[][] DEFAULT_PIECE_TYPE_GRID
           
 
Fields inherited from interface net.sourceforge.simplegamenet.chess.ChessGridSize
GRID_HEIGHT, GRID_WIDTH
 
Fields inherited from interface net.sourceforge.simplegamenet.chess.ChessPlayFieldState
CHECK, CHECKMATE, NORMAL_STATE, REMISE, STALEMATE, YIELDED
 
Fields inherited from interface net.sourceforge.simplegamenet.chess.ChessPieceType
BISHOP, KING, KNIGHT, NO_TYPE, PAWN, QUEEN, ROOK
 
Fields inherited from interface net.sourceforge.simplegamenet.chess.ChessPieceOwner
BLACK_OWNER, NO_OWNER, WHITE_OWNER
 
Constructor Summary
ChessPlayField(Integer[] participantsOrder)
           
 
Method Summary
 int doMove(int sourceX, int sourceY, int destinationX, int destinationY, int chosenPieceType)
           
 boolean[][] getMoveDestinationAllowedGrid(int sourceX, int sourceY)
           
 boolean[][] getMoveSourceAllowedGrid()
           
 Integer getParticipantAtTurnPlayerID()
           
 ChessPiece[] getPieceGrid()
           
 int[][] getPieceOwnerGrid()
           
 int getPieceOwnerSight(Integer clientPlayerID)
           
 int[][] getPieceTypeGrid()
           
 int getPlayFieldState()
           
 int getState()
           
static boolean isCheckAfterMoveState(ChessPiece[] checkingPieceGrid, int participantsOwnerIndex)
           
static boolean isCheckState(ChessPiece[] checkingPieceGrid, int participantsOwnerIndex)
           
 boolean isMoveAllowed(int sourceX, int sourceY, int destinationX, int destinationY, int chosenPieceType)
           
 boolean isReplaceChoiceNeeded(int sourceX, int sourceY, int destinationX, int destinationY)
           
 int setRemiseOfferAnswer(boolean remiseOfferAccepted)
           
 void setWaitingForRemiseOfferAnswer()
           
 int yieldGame(Integer playerID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PIECE_TYPE_GRID

public static final int[][] DEFAULT_PIECE_TYPE_GRID

DEFAULT_PIECE_OWNER_GRID

public static final int[][] DEFAULT_PIECE_OWNER_GRID
Constructor Detail

ChessPlayField

public ChessPlayField(Integer[] participantsOrder)
Method Detail

isCheckState

public static boolean isCheckState(ChessPiece[] checkingPieceGrid,
                                   int participantsOwnerIndex)

isCheckAfterMoveState

public static boolean isCheckAfterMoveState(ChessPiece[] checkingPieceGrid,
                                            int participantsOwnerIndex)

getParticipantAtTurnPlayerID

public Integer getParticipantAtTurnPlayerID()

isMoveAllowed

public boolean isMoveAllowed(int sourceX,
                             int sourceY,
                             int destinationX,
                             int destinationY,
                             int chosenPieceType)

doMove

public int doMove(int sourceX,
                  int sourceY,
                  int destinationX,
                  int destinationY,
                  int chosenPieceType)

setWaitingForRemiseOfferAnswer

public void setWaitingForRemiseOfferAnswer()

setRemiseOfferAnswer

public int setRemiseOfferAnswer(boolean remiseOfferAccepted)

yieldGame

public int yieldGame(Integer playerID)

getMoveSourceAllowedGrid

public boolean[][] getMoveSourceAllowedGrid()

getMoveDestinationAllowedGrid

public boolean[][] getMoveDestinationAllowedGrid(int sourceX,
                                                 int sourceY)

isReplaceChoiceNeeded

public boolean isReplaceChoiceNeeded(int sourceX,
                                     int sourceY,
                                     int destinationX,
                                     int destinationY)

getPieceOwnerSight

public int getPieceOwnerSight(Integer clientPlayerID)

getPlayFieldState

public int getPlayFieldState()

getPieceTypeGrid

public int[][] getPieceTypeGrid()

getPieceOwnerGrid

public int[][] getPieceOwnerGrid()

getState

public int getState()

getPieceGrid

public ChessPiece[] getPieceGrid()


Copyright © 2003-2004 The 3 Belgians. All Rights Reserved.