|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.game.action.AbstractAction
org.vizzini.game.boardgame.action.AbstractGridBoardAction
org.vizzini.game.boardgame.action.AbstractMoveAction
org.vizzini.game.boardgame.chess.action.CastleAction
public class CastleAction
Provides an agent action for castle movement of a chess King and Rook.
Constructor Summary | |
---|---|
protected |
CastleAction(IChessEnvironment board,
IChessAgent agent,
IntegerPosition kingFromPosition,
IntegerPosition kingToPosition,
IntegerPosition rookFromPosition,
IntegerPosition rookToPosition)
Construct this object with the given arguments. |
Method Summary | |
---|---|
int |
compareTo(Object object)
Compare this to the given object. |
boolean |
doIt()
Perform the command encapsulated by this object. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
static CastleAction |
get(IChessEnvironment board,
IChessAgent agent,
IntegerPosition kingFromPosition,
IntegerPosition kingToPosition,
IntegerPosition rookFromPosition,
IntegerPosition rookToPosition)
Return an instance of this class using the given parameters. |
IntegerPosition |
getFromPosition()
|
IntegerPosition |
getKingFromPosition()
|
IntegerPosition |
getKingToPosition()
|
IntegerPosition |
getRookFromPosition()
Return the Rook from position. |
IntegerPosition |
getRookToPosition()
Return the Rook to position. |
IntegerPosition |
getToPosition()
|
int |
hashCode()
Returns a hash code value for the object. |
static void |
poolReport()
Log a statistics report. |
void |
release()
Return this instance to the reusable object pool. |
protected void |
set(IChessEnvironment board,
IChessAgent agent,
IntegerPosition kingFromPosition,
IntegerPosition kingToPosition,
IntegerPosition rookFromPosition,
IntegerPosition rookToPosition)
Set parameters on this object. |
String |
toString()
Return a string representation of this object. |
boolean |
undoIt()
Undo the last invocation of doIt. |
Methods inherited from class org.vizzini.game.boardgame.action.AbstractMoveAction |
---|
clear, prettyPrint, setFromPosition |
Methods inherited from class org.vizzini.game.boardgame.action.AbstractGridBoardAction |
---|
getGridBoard, setGridBoard, setToPosition |
Methods inherited from class org.vizzini.game.action.AbstractAction |
---|
getAgent, getRating, setAgent, setRating |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.vizzini.game.boardgame.action.IGridBoardAction |
---|
getGridBoard |
Methods inherited from interface org.vizzini.game.action.IAction |
---|
getAgent, getRating, setAgent, setRating |
Constructor Detail |
---|
protected CastleAction(IChessEnvironment board, IChessAgent agent, IntegerPosition kingFromPosition, IntegerPosition kingToPosition, IntegerPosition rookFromPosition, IntegerPosition rookToPosition)
board
- Chess board. (required)agent
- The agent making this action. (required)kingFromPosition
- The king from position. (required)kingToPosition
- The king to position. (required)rookFromPosition
- The rook from position. (required)rookToPosition
- The rook to position. (required)Method Detail |
---|
public static CastleAction get(IChessEnvironment board, IChessAgent agent, IntegerPosition kingFromPosition, IntegerPosition kingToPosition, IntegerPosition rookFromPosition, IntegerPosition rookToPosition)
public static void poolReport()
public int compareTo(Object object)
compareTo
in interface Comparable
compareTo
in class AbstractMoveAction
ClassCastException
- if another is not an instance of
AbstractAction
.public boolean doIt()
doIt
in interface IAction
doIt
in class AbstractAction
public boolean equals(Object object)
equals
in interface IAction
equals
in class AbstractMoveAction
object
- The object to compare.public IntegerPosition getFromPosition()
getFromPosition
in interface IMoveAction
getFromPosition
in class AbstractMoveAction
public IntegerPosition getKingFromPosition()
public IntegerPosition getKingToPosition()
public IntegerPosition getRookFromPosition()
public IntegerPosition getRookToPosition()
public IntegerPosition getToPosition()
getToPosition
in interface IGridBoardAction
getToPosition
in class AbstractGridBoardAction
public int hashCode()
hashCode
in interface IAction
hashCode
in class AbstractMoveAction
public void release()
release
in interface IAction
release
in class AbstractAction
public String toString()
toString
in class AbstractAction
public boolean undoIt()
undoIt
in interface IAction
undoIt
in class AbstractAction
protected void set(IChessEnvironment board, IChessAgent agent, IntegerPosition kingFromPosition, IntegerPosition kingToPosition, IntegerPosition rookFromPosition, IntegerPosition rookToPosition)
|
||||||||||
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 |