org.vizzini.game.boardgame.action
Class AbstractMoveAction

java.lang.Object
  extended by org.vizzini.game.action.AbstractAction
      extended by org.vizzini.game.boardgame.action.AbstractGridBoardAction
          extended by org.vizzini.game.boardgame.action.AbstractMoveAction
All Implemented Interfaces:
Serializable, Comparable, IAction, IGridBoardAction, IMoveAction
Direct Known Subclasses:
CastleAction, EnPassantCaptureAction, MoveAction, MoveCaptureAction, PawnPromotionAction, PawnPromotionCaptureAction

public abstract class AbstractMoveAction
extends AbstractGridBoardAction
implements IMoveAction

Provides base functionality for move actions in the game framework.

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

Constructor Summary
protected AbstractMoveAction(IGridBoard gridBoard, IAgent agent, IntegerPosition fromPosition)
          Construct this object.
 
Method Summary
 void clear()
          Clear the properties of this object.
 int compareTo(Object object)
          Compare this to the given object.
 boolean equals(Object object)
          Return true if the given object is equal to this.
 IntegerPosition getFromPosition()
           
 int hashCode()
          Returns a hash code value for the object.
 String prettyPrint()
          Provide a nicely formatted string representation of this object.
protected  void setFromPosition(IntegerPosition position)
          Set the from position.
 
Methods inherited from class org.vizzini.game.boardgame.action.AbstractGridBoardAction
getGridBoard, getToPosition, setGridBoard, setToPosition
 
Methods inherited from class org.vizzini.game.action.AbstractAction
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.boardgame.action.IGridBoardAction
getGridBoard, getToPosition
 
Methods inherited from interface org.vizzini.game.action.IAction
doIt, getAgent, getRating, release, setAgent, setRating, undoIt
 

Constructor Detail

AbstractMoveAction

protected AbstractMoveAction(IGridBoard gridBoard,
                             IAgent agent,
                             IntegerPosition fromPosition)
Construct this object.

Since:
v0.3
Method Detail

clear

public void clear()
Clear the properties of this object.

Specified by:
clear in interface IAction
Overrides:
clear in class AbstractGridBoardAction
Since:
v0.3

compareTo

public int compareTo(Object object)
Compare this to the given object.

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class AbstractAction
Returns:
-1,0,1 if this is less than, equal to, greater than object.
Throws:
ClassCastException - if another is not an instance of AbstractMoveAction.
Since:
v0.3

equals

public boolean equals(Object object)
Return true if the given object is equal to this.

Specified by:
equals in interface IAction
Overrides:
equals in class AbstractGridBoardAction
Parameters:
object - The object to compare.
Since:
v0.3

getFromPosition

public IntegerPosition getFromPosition()
Specified by:
getFromPosition in interface IMoveAction
Returns:
Returns the fromPosition.
Since:
v0.3

hashCode

public int hashCode()
Returns a hash code value for the object.

Specified by:
hashCode in interface IAction
Overrides:
hashCode in class AbstractGridBoardAction
Since:
v0.3

prettyPrint

public String prettyPrint()
Provide a nicely formatted string representation of this object.

Specified by:
prettyPrint in interface IAction
Overrides:
prettyPrint in class AbstractGridBoardAction
Since:
v0.3

setFromPosition

protected void setFromPosition(IntegerPosition position)
Set the from position.

Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02