|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.action.AbstractAction
public abstract class AbstractAction
Provides base functionality for actions in the game framework. An action instance encapsulates the information necessary for the environment to process the action. Examples are moving a chess piece, moving a paddle to hit a ball, or playing a card.
This class participates in the Command pattern as described in Patterns In Java Volume 1, Mark Grand, 1998.
| Constructor Summary | |
|---|---|
AbstractAction()
Construct this object. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the properties of this object. |
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. |
IAgent |
getAgent()
Return the agent who originated this action. |
int |
getRating()
Return the rating of this action. |
int |
hashCode()
Returns a hash code value for the object. |
String |
prettyPrint()
Provide a nicely formatted string representation of this object. |
void |
release()
Return this instance to the reusable object pool, if one is used. |
void |
setAgent(IAgent agent)
Set the agent who originated this action. |
void |
setRating(int rating)
Set the rating of this action. |
String |
toString()
Return a string representation of this object. |
boolean |
undoIt()
Undo the last invocation of doIt. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractAction()
| Method Detail |
|---|
public void clear()
clear in interface IActionpublic int compareTo(Object object)
compareTo in interface ComparableClassCastException - if another is not an instance of
AbstractAction.public boolean doIt()
doIt in interface IActionpublic boolean equals(Object object)
equals in interface IActionequals in class Objectobject - The object to compare.public IAgent getAgent()
getAgent in interface IActionpublic int getRating()
getRating in interface IActionpublic int hashCode()
hashCode in interface IActionhashCode in class Objectpublic String prettyPrint()
prettyPrint in interface IActionpublic void release()
release in interface IActionpublic void setAgent(IAgent agent)
setAgent in interface IActionagent - The agent who originated this action.public void setRating(int rating)
setRating in interface IActionpublic String toString()
toString in class Objectpublic boolean undoIt()
undoIt in interface IAction
|
||||||||||
| 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 |