|
||||||||||
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
public abstract class AbstractGridBoardAction
Provides base functionality for grid board actions in the game framework. A grid board action instance encapsulates the information necessary for the environment to process the action. Examples are moving a chess piece, placing a token, or capturing a token.
This class participates in the Command pattern as described in Patterns In Java Volume 1, Mark Grand, 1998.
Constructor Summary | |
---|---|
AbstractGridBoardAction(IGridBoard gridBoard,
IAgent agent)
Construct this object. |
Method Summary | |
---|---|
void |
clear()
Clear the properties of this object. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
IGridBoard |
getGridBoard()
Return the gridBoard. |
IntegerPosition |
getToPosition()
|
int |
hashCode()
Returns a hash code value for the object. |
String |
prettyPrint()
Provide a nicely formatted string representation of this object. |
protected void |
setGridBoard(IGridBoard gridBoard)
Set the GridBoard. |
protected void |
setToPosition(IntegerPosition position)
Set the to position. |
Methods inherited from class org.vizzini.game.action.AbstractAction |
---|
compareTo, doIt, getAgent, getRating, release, setAgent, setRating, toString, undoIt |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.vizzini.game.action.IAction |
---|
doIt, getAgent, getRating, release, setAgent, setRating, undoIt |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public AbstractGridBoardAction(IGridBoard gridBoard, IAgent agent)
Method Detail |
---|
public void clear()
clear
in interface IAction
clear
in class AbstractAction
public boolean equals(Object object)
equals
in interface IAction
equals
in class AbstractAction
object
- The object to compare.public IGridBoard getGridBoard()
IGridBoardAction
getGridBoard
in interface IGridBoardAction
public IntegerPosition getToPosition()
getToPosition
in interface IGridBoardAction
public int hashCode()
hashCode
in interface IAction
hashCode
in class AbstractAction
public String prettyPrint()
prettyPrint
in interface IAction
prettyPrint
in class AbstractAction
protected void setGridBoard(IGridBoard gridBoard)
protected void setToPosition(IntegerPosition position)
|
||||||||||
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 |