|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.AbstractEnvironment
org.vizzini.game.boardgame.AbstractGridBoard
org.vizzini.game.boardgame.chess.AbstractChessEnvironment
public abstract class AbstractChessEnvironment
Provides a chess grid board for 3D chess.
| Field Summary | |
|---|---|
protected CheckManager |
_checkManager
Check manager. |
| Fields inherited from class org.vizzini.game.boardgame.AbstractGridBoard |
|---|
UNDO_ACTION |
| Constructor Summary | |
|---|---|
AbstractChessEnvironment()
|
|
| Method Summary | |
|---|---|
void |
addCheckListener(ICheckListener listener)
Add the given listener. |
void |
configure(Properties properties)
Configure this environment. |
void |
copy(IEnvironment environment)
Copy data from the given instance into this. |
protected ITokenCollection |
createInitialTokens()
Create the initial tokens from the cached properties. |
protected IChessToken |
createToken(IChessAgent agent)
Create a new token. |
IChessAgent |
getAgent(boolean isWhite)
Return the proper agent for the given flag. |
IChessAgent |
getAgentBlack()
Return the agent for the black team. |
IChessAgent |
getAgentWhite()
Return the agent for the white team. |
int |
getEnPassantRank(boolean isWhite)
Return the en passant capture rank (if any) for the given parameter. |
List |
getHintPositionsFor(IntegerPosition position,
IAdjudicator adjudicator)
Return the hint positions for the given position. |
IntegerPosition |
getInitialKingPosition(boolean isWhite)
Return the initial king position. |
IntegerPosition |
getInitialKingsRookPosition(boolean isWhite)
Return the initial king's rook position. |
IntegerPosition |
getInitialQueensRookPosition(boolean isWhite)
Return the initial queen's rook position. |
int |
getKingsCastleDeltaFile(boolean isKingSide)
Return the King's delta file for either king-side or queen-side castling. |
IChessAgent |
getOpponent(IChessAgent agent)
Return the opposing agent to the given agent. |
int |
getRooksCastleDeltaFile(boolean isKingSide)
Return the Rook's delta file for either king-side or queen-side castling. |
ITeam |
getTeamBlack()
Return the team for black. |
ITeam |
getTeamWhite()
Return the team for white. |
boolean |
isCastlingAllowed()
Return true if this environment allows castling. |
boolean |
isEnPassantCaptureAllowed()
Return true if this environment allows en passant capture. |
boolean |
isFiringChecks()
Return true if this is set to fire check events. |
boolean |
isInitialPosition(Class tokenClass,
ITeam team,
IntegerPosition position)
Return true if the given coordinates are the initial position for a Pawn. |
boolean |
isKingsSide(IntegerPosition rookPos,
IntegerPosition kingPos)
Return true if the given Rook position is King's side. |
boolean |
isPawnInitialPosition(ITeam team,
IntegerPosition position)
Return true if the given coordinates are the initial position for a Pawn. |
void |
performAction(IAction action)
Perform the given movement agent action. |
void |
removeCheckListener(ICheckListener listener)
Remove the given listener. |
void |
reset()
Reset to the initial state. |
void |
setFiringChecks(boolean fire)
Set the flag which indicates whether to fire state change events. |
| Methods inherited from class org.vizzini.game.boardgame.AbstractGridBoard |
|---|
agentTokenCount, coordsToIndex, get, getCellCount, getCurrentAgent, getFileCount, getLastAgent, getLevelCount, getMaxDimension, getRankCount, indexToFile, indexToLevel, indexToPosition, indexToRank, is3D, isActionHistoryUsed, isPositionUsable, isPositionUsable, isRedoAllowed, isUndoAllowed, positionToIndex, setActionHistoryUsed, setLastAgent, setToken, setToken, undoAction |
| Methods inherited from class org.vizzini.game.AbstractEnvironment |
|---|
addStateListener, clone, equals, get, getAdjudicator, getAgentCollection, getStateManager, getTeamCollection, getTokenCollection, getTokenCollectionClass, getTurnNumber, hashCode, incrementTurnNumber, isFiringStateChanges, open, performActions, removeStateListener, setAdjudicator, setAgentCollection, setFiringStateChanges, setTokenCollectionClass, setTurnNumber, update |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.vizzini.game.boardgame.IGridBoard |
|---|
agentTokenCount, coordsToIndex, get, getCellCount, getFileCount, getLastAgent, getLevelCount, getMaxDimension, getRankCount, indexToFile, indexToLevel, indexToPosition, indexToRank, is3D, isActionHistoryUsed, isPositionUsable, isPositionUsable, isRedoAllowed, isUndoAllowed, positionToIndex, setActionHistoryUsed, setToken, setToken |
| Methods inherited from interface org.vizzini.game.IEnvironment |
|---|
addStateListener, clone, get, getAdjudicator, getAgentCollection, getTeamCollection, getTokenCollection, getTurnNumber, incrementTurnNumber, isFiringStateChanges, open, performActions, removeStateListener, setAdjudicator, setAgentCollection, setFiringStateChanges, setTurnNumber, undoAction, update |
| Field Detail |
|---|
protected transient CheckManager _checkManager
| Constructor Detail |
|---|
public AbstractChessEnvironment()
| Method Detail |
|---|
public void addCheckListener(ICheckListener listener)
addCheckListener in interface IChessEnvironment
public void configure(Properties properties)
throws InstantiationException,
IllegalAccessException
configure in interface IEnvironmentconfigure in class AbstractGridBoardproperties - Source of configuration information.
InstantiationException
IllegalAccessExceptionpublic void copy(IEnvironment environment)
copy in interface IEnvironmentcopy in class AbstractGridBoardenvironment - Environment from which to copy data.public IChessAgent getAgent(boolean isWhite)
getAgent in interface IChessEnvironmentisWhite - Flag indicating whether to return the white agent.public IChessAgent getAgentBlack()
getAgentBlack in interface IChessEnvironmentpublic IChessAgent getAgentWhite()
getAgentWhite in interface IChessEnvironmentpublic int getEnPassantRank(boolean isWhite)
getEnPassantRank in interface IChessEnvironmentisWhite - Flag indicating whether White or Black.
public List getHintPositionsFor(IntegerPosition position,
IAdjudicator adjudicator)
getHintPositionsFor in interface IChessEnvironmentpublic IntegerPosition getInitialKingPosition(boolean isWhite)
getInitialKingPosition in interface IChessEnvironmentpublic IntegerPosition getInitialKingsRookPosition(boolean isWhite)
getInitialKingsRookPosition in interface IChessEnvironmentpublic IntegerPosition getInitialQueensRookPosition(boolean isWhite)
getInitialQueensRookPosition in interface IChessEnvironmentpublic int getKingsCastleDeltaFile(boolean isKingSide)
getKingsCastleDeltaFile in interface IChessEnvironmentpublic IChessAgent getOpponent(IChessAgent agent)
getOpponent in interface IChessEnvironmentpublic int getRooksCastleDeltaFile(boolean isKingSide)
getRooksCastleDeltaFile in interface IChessEnvironmentpublic ITeam getTeamBlack()
getTeamBlack in interface IChessEnvironmentpublic ITeam getTeamWhite()
getTeamWhite in interface IChessEnvironmentpublic boolean isCastlingAllowed()
isCastlingAllowed in interface IChessEnvironmentpublic boolean isEnPassantCaptureAllowed()
isEnPassantCaptureAllowed in interface IChessEnvironmentpublic boolean isFiringChecks()
isFiringChecks in interface IChessEnvironment
public boolean isInitialPosition(Class tokenClass,
ITeam team,
IntegerPosition position)
isInitialPosition in interface IChessEnvironment
public boolean isKingsSide(IntegerPosition rookPos,
IntegerPosition kingPos)
public boolean isPawnInitialPosition(ITeam team,
IntegerPosition position)
isPawnInitialPosition in interface IChessEnvironmentpublic void performAction(IAction action)
performAction in interface IEnvironmentperformAction in class AbstractGridBoardaction - Action.public void removeCheckListener(ICheckListener listener)
removeCheckListener in interface IChessEnvironmentpublic void reset()
reset in interface IEnvironmentreset in class AbstractEnvironmentpublic void setFiringChecks(boolean fire)
setFiringChecks in interface IChessEnvironment
protected ITokenCollection createInitialTokens()
throws InstantiationException,
IllegalAccessException
createInitialTokens in class AbstractEnvironmentInstantiationException
IllegalAccessExceptionprotected IChessToken createToken(IChessAgent agent)
agent - The token's associated agent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |