org.vizzini.game.boardgame.chess
Interface IChessAdjudicator

All Superinterfaces:
IAdjudicator, IGridBoardAdjudicator
All Known Implementing Classes:
ChessAdjudicator

public interface IChessAdjudicator
extends IGridBoardAdjudicator

Defines methods required by chess adjudicators in the 3D chess framework. An adjudicator instance encapsulates the rules of a game by determining the legality of actions and when the game is over.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
 int getPawnPromotionLevel(IChessEnvironment board, boolean isWhite)
          Return the level for pawn promotion.
 int getPawnPromotionRank(IChessEnvironment board, boolean isWhite)
          Return the rank for pawn promotion.
 boolean isCastleActionLegal(IChessEnvironment board, IChessAgent agent, IntegerPosition kingFromPosition, IntegerPosition kingToPosition, IntegerPosition rookFromPosition, IntegerPosition rookToPosition)
          Return true if the given agent action is legal in the given environment.
 boolean isEnPassantCaptureActionLegal(IChessEnvironment board, IChessAgent agent, IntegerPosition fromPosition, IntegerPosition capturePosition, IntegerPosition toPosition)
          Return true if the given agent action is legal in the given environment.
 boolean isInCheck(IChessEnvironment board, IChessAgent agent)
          Return true if the given agent's King is in check.
 boolean isInCheckmate(IChessEnvironment board, IChessAgent agent)
          Return true if the given agent's King is in checkmate.
 boolean isInPawnPromotionRange(IChessEnvironment board, IntegerPosition toPosition, boolean isWhite)
          Return true if the given position is in pawn promotion range for the given board and team.
 boolean isMoveActionLegal(IChessEnvironment board, IChessAgent agent, IntegerPosition fromPosition, IntegerPosition toPosition)
          Return true if the given agent action is legal in the given environment.
 boolean isMoveCaptureActionLegal(IChessEnvironment board, IChessAgent agent, IntegerPosition fromPosition, IntegerPosition toPosition)
          Return true if the given agent action is legal in the given environment.
 boolean isPawnPromotionActionLegal(IChessEnvironment board, IChessAgent agent, IntegerPosition fromPosition, IntegerPosition toPosition)
          Return true if the given agent action is legal in the given environment.
 boolean isPawnPromotionCaptureActionLegal(IChessEnvironment board, IChessAgent agent, IntegerPosition fromPosition, IntegerPosition toPosition)
          Return true if the given agent action is legal in the given environment.
 
Methods inherited from interface org.vizzini.game.boardgame.IGridBoardAdjudicator
agentHasLine, getWinningPositions
 
Methods inherited from interface org.vizzini.game.IAdjudicator
areActionsLegal, getWinner, isActionLegal, isGameOver, isGoal, reset, setWinner
 

Method Detail

getPawnPromotionLevel

int getPawnPromotionLevel(IChessEnvironment board,
                          boolean isWhite)
Return the level for pawn promotion.

Parameters:
board - Chess board.
isWhite - Flag indicating if the token is white.
Since:
v0.3

getPawnPromotionRank

int getPawnPromotionRank(IChessEnvironment board,
                         boolean isWhite)
Return the rank for pawn promotion.

Parameters:
board - Chess board.
isWhite - Flag indicating if the token is white.
Since:
v0.3

isCastleActionLegal

boolean isCastleActionLegal(IChessEnvironment board,
                            IChessAgent agent,
                            IntegerPosition kingFromPosition,
                            IntegerPosition kingToPosition,
                            IntegerPosition rookFromPosition,
                            IntegerPosition rookToPosition)
Return true if the given agent action is legal in the given environment.

Parameters:
board - Chess environment.
agent - Chess agent.
kingFromPosition - King from position.
kingToPosition - King to position.
rookFromPosition - Rook from position.
rookToPosition - Rook to position.
Returns:
true if the given agent action is legal in the given environment.
Since:
v0.3

isEnPassantCaptureActionLegal

boolean isEnPassantCaptureActionLegal(IChessEnvironment board,
                                      IChessAgent agent,
                                      IntegerPosition fromPosition,
                                      IntegerPosition capturePosition,
                                      IntegerPosition toPosition)
Return true if the given agent action is legal in the given environment.

Parameters:
board - Chess environment.
agent - Chess agent.
fromPosition - From position.
capturePosition - Capture position.
toPosition - To position.
Returns:
true if the given agent action is legal in the given environment.
Since:
v0.3

isInCheck

boolean isInCheck(IChessEnvironment board,
                  IChessAgent agent)
Return true if the given agent's King is in check.

Parameters:
board - Chess environment.
agent - Chess agent.
Since:
v0.3

isInCheckmate

boolean isInCheckmate(IChessEnvironment board,
                      IChessAgent agent)
Return true if the given agent's King is in checkmate.

Parameters:
board - Chess environment.
agent - Chess agent.
Since:
v0.3

isInPawnPromotionRange

boolean isInPawnPromotionRange(IChessEnvironment board,
                               IntegerPosition toPosition,
                               boolean isWhite)
Return true if the given position is in pawn promotion range for the given board and team.

Parameters:
board - Chess board.
toPosition - To position.
isWhite - Flag indicating if the token is white.
Since:
v0.3

isMoveActionLegal

boolean isMoveActionLegal(IChessEnvironment board,
                          IChessAgent agent,
                          IntegerPosition fromPosition,
                          IntegerPosition toPosition)
Return true if the given agent action is legal in the given environment.

Parameters:
board - Chess environment.
agent - Chess agent.
fromPosition - From position.
toPosition - To position.
Returns:
true if the given agent action is legal in the given environment.
Since:
v0.3

isMoveCaptureActionLegal

boolean isMoveCaptureActionLegal(IChessEnvironment board,
                                 IChessAgent agent,
                                 IntegerPosition fromPosition,
                                 IntegerPosition toPosition)
Return true if the given agent action is legal in the given environment.

Parameters:
board - Chess environment.
agent - Chess agent.
fromPosition - From position.
toPosition - To position.
Returns:
true if the given agent action is legal in the given environment.
Since:
v0.3

isPawnPromotionActionLegal

boolean isPawnPromotionActionLegal(IChessEnvironment board,
                                   IChessAgent agent,
                                   IntegerPosition fromPosition,
                                   IntegerPosition toPosition)
Return true if the given agent action is legal in the given environment.

Parameters:
board - Chess environment.
agent - Chess agent.
fromPosition - From position.
toPosition - To position.
Returns:
true if the given agent action is legal in the given environment.
Since:
v0.3

isPawnPromotionCaptureActionLegal

boolean isPawnPromotionCaptureActionLegal(IChessEnvironment board,
                                          IChessAgent agent,
                                          IntegerPosition fromPosition,
                                          IntegerPosition toPosition)
Return true if the given agent action is legal in the given environment.

Parameters:
board - Chess environment.
agent - Chess agent.
fromPosition - From position.
toPosition - To position.
Returns:
true if the given agent action is legal in the given environment.
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02