|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.AbstractToken
org.vizzini.game.boardgame.chess.AbstractChessToken
org.vizzini.game.boardgame.chess.standardtoken.King
public class King
Provides a King for 3D chess. This token travels in the directions of the Rook, Bishop, or Mace, but limited to a distance of one.
| Field Summary | |
|---|---|
protected static BitSet[] |
_possibleCastlePositions
Array of index to possible castle position bit set. |
protected static BitSet[] |
_possiblePositions
Array of index to possible position bit set. |
| Fields inherited from class org.vizzini.game.boardgame.chess.AbstractChessToken |
|---|
_emptyBitSet, ONES, TWOS, ZERO |
| Fields inherited from class org.vizzini.game.AbstractToken |
|---|
UNKNOWN_NAME |
| Fields inherited from interface org.vizzini.game.IToken |
|---|
AGENT_PROPERTY, NAME_PROPERTY, POSITION_PROPERTY, TEAM_PROPERTY |
| Constructor Summary | |
|---|---|
King()
Construct this object with no agent as this token's owner. |
|
| Method Summary | |
|---|---|
protected static void |
generatePossibleCastlePositions(IChessEnvironment board,
IntegerPosition kingFromPosition)
Fill the possible positions list. |
protected static void |
generatePossiblePositions(IChessAgent agent,
IChessEnvironment board,
int index)
Fill the possible positions list. |
List |
getPossibleActions(IAgent agent0,
IEnvironment environment,
IAdjudicator adjudicator)
Return a list of possible legal agent actions. |
BitSet |
getPossibleCastlePositions(IChessEnvironment board)
Return a list of the possible castle positions this token could take. |
protected static BitSet[] |
getPossibleCastlePositionsArray(IChessEnvironment board)
Return the possible positions array. |
BitSet |
getPossibleMoveCapturePositions(IChessEnvironment board)
Return a list of the possible move capture positions this token could take. |
BitSet |
getPossibleMovePositions(IChessEnvironment board)
Return a list of the possible move positions this token could take. |
protected static BitSet[] |
getPossiblePositionsArray(IChessEnvironment board)
Return the possible positions array. |
static void |
reset()
Reset cached data. |
protected void |
setPossiblePosition(IChessEnvironment board,
int positionIndex,
int moveIndex)
Set the possible position. |
| Methods inherited from class org.vizzini.game.AbstractToken |
|---|
addPropertyChangeListener, clone, equals, getAgent, getIndex, getName, getPosition, getPropertyChangeManager, getTeam, getValue, hashCode, isFiringPositionChanges, removePropertyChangeListener, setAgent, setFiringPositionChanges, setIndex, setName, setPosition, setValue, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.vizzini.game.boardgame.chess.IKing |
|---|
isPossibleCastlePosition |
| Methods inherited from interface org.vizzini.game.boardgame.chess.IChessToken |
|---|
isPossibleMoveCapturePosition, isPossibleMovePosition, isWhite |
| Methods inherited from interface org.vizzini.game.IToken |
|---|
addPropertyChangeListener, clone, configure, getAgent, getIndex, getName, getPosition, getTeam, getValue, removePropertyChangeListener, setAgent, setName, setPosition, setTeam, setValue |
| Field Detail |
|---|
protected static BitSet[] _possiblePositions
protected static BitSet[] _possibleCastlePositions
| Constructor Detail |
|---|
public King()
| Method Detail |
|---|
public static void reset()
public List getPossibleActions(IAgent agent0,
IEnvironment environment,
IAdjudicator adjudicator)
getPossibleActions in interface IBoardGameTokengetPossibleActions in class AbstractChessTokenagent0 - Agent.environment - The current environment.adjudicator - Adjudicator for determining legal actions.public BitSet getPossibleCastlePositions(IChessEnvironment board)
getPossibleCastlePositions in interface IKinggetPossibleCastlePositions in class AbstractChessTokenboard - Chess board.public BitSet getPossibleMoveCapturePositions(IChessEnvironment board)
getPossibleMoveCapturePositions in interface IChessTokenboard - Chess board.public BitSet getPossibleMovePositions(IChessEnvironment board)
getPossibleMovePositions in interface IChessTokenboard - Chess board.
protected static void generatePossibleCastlePositions(IChessEnvironment board,
IntegerPosition kingFromPosition)
board - Grid board environment.kingFromPosition - Token position.
protected static void generatePossiblePositions(IChessAgent agent,
IChessEnvironment board,
int index)
board - Grid board environment.index - Token position as an index.protected static BitSet[] getPossibleCastlePositionsArray(IChessEnvironment board)
protected static BitSet[] getPossiblePositionsArray(IChessEnvironment board)
protected void setPossiblePosition(IChessEnvironment board,
int positionIndex,
int moveIndex)
positionIndex - This token's position as an index.moveIndex - The to position as an index.
|
||||||||||
| 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 |