org.vizzini.game.boardgame.chess.standardtoken
Class Rook

java.lang.Object
  extended by org.vizzini.game.AbstractToken
      extended by org.vizzini.game.boardgame.chess.AbstractChessToken
          extended by org.vizzini.game.boardgame.chess.standardtoken.Rook
All Implemented Interfaces:
Serializable, Cloneable, IChessToken, IRook, IBoardGameToken, IToken

public class Rook
extends AbstractChessToken
implements IRook

Provides a Rook for 3D chess. This token travels in (±n,0,0), (0,±n,0), or (0,0,±n). This token can optionally be given the triagonal move (±n,±n,±n).

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
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
Rook()
          Construct this object with no agent as this token's owner.
 
Method Summary
protected static void generatePossiblePositions(IChessEnvironment board, IntegerPosition position)
          Fill the possible positions list.
 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 boolean isTriagonal()
          Return true if this uses the triagonal move.
static void reset()
          Reset cached data.
static void setTriagonal(boolean isTriagonal)
          Set the triagonal flag.
 
Methods inherited from class org.vizzini.game.boardgame.chess.AbstractChessToken
addCastleActions, addEnPassantCaptureActions, addMoveActions, addMoveCaptureActions, addPawnPromotionActions, addPawnPromotionCaptureActions, addPossiblePosition, addPossiblePositions, configure, copy, createCastleAction, createEnPassantCaptureAction, createMoveAction, createMoveCaptureAction, createPawnPromotionAction, createPawnPromotionCaptureAction, getCounters, getEmptyBitSet, getPossibleActions, getPossibleCastlePositions, getPossibleEnPassantCapturePositions, getPossiblePawnPromotionCapturePositions, getPossiblePawnPromotionPositions, isPossibleCastlePosition, isPossibleEnPassantCapturePosition, isPossibleMoveCapturePosition, isPossibleMovePosition, isPossiblePawnPromotionCapturePosition, isPossiblePawnPromotionPosition, isWhite, setTeam
 
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.IChessToken
isPossibleMoveCapturePosition, isPossibleMovePosition, isWhite
 
Methods inherited from interface org.vizzini.game.boardgame.IBoardGameToken
getPossibleActions
 
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

_possiblePositions

protected static BitSet[] _possiblePositions
Array of index to possible position bit set.

Constructor Detail

Rook

public Rook()
Construct this object with no agent as this token's owner.

Since:
v0.3
Method Detail

isTriagonal

public static boolean isTriagonal()
Return true if this uses the triagonal move.

Since:
v0.3

reset

public static void reset()
Reset cached data.

Since:
v0.3

setTriagonal

public static void setTriagonal(boolean isTriagonal)
Set the triagonal flag.

Since:
v0.3

getPossibleMoveCapturePositions

public BitSet getPossibleMoveCapturePositions(IChessEnvironment board)
Return a list of the possible move capture positions this token could take.

Specified by:
getPossibleMoveCapturePositions in interface IChessToken
Parameters:
board - Chess board.
Since:
v0.3

getPossibleMovePositions

public BitSet getPossibleMovePositions(IChessEnvironment board)
Return a list of the possible move positions this token could take.

Specified by:
getPossibleMovePositions in interface IChessToken
Parameters:
board - Chess board.
Since:
v0.3

generatePossiblePositions

protected static void generatePossiblePositions(IChessEnvironment board,
                                                IntegerPosition position)
Fill the possible positions list.

Parameters:
board - Grid board environment.
position - Token position.
Since:
v0.3

getPossiblePositionsArray

protected static BitSet[] getPossiblePositionsArray(IChessEnvironment board)
Return the possible positions array.

Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02