|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.game.action.ActionManager
public class ActionManager
Provides a manager for game actions. Instances of this class are responsible for managing the execution of actions, and maintaining an action history for undo and redo.
This class participates in the Command pattern as described in Patterns In Java Volume 1, Mark Grand, 1998.
Constructor Summary | |
---|---|
ActionManager()
|
Method Summary | |
---|---|
protected void |
addToHistory(IAction action)
Add an action to the action history. |
protected IStack |
createStack()
Return a new IStack object. |
protected IAction |
getHistoryAction(int index)
Return the history action at the given index. |
protected int |
getHistorySize()
Return the number of items in the history list. |
protected int |
getRedoSize()
Return the number of items in the redo list. |
void |
invokeAction(IAction action)
Invoke an action and add it to the history. |
boolean |
isHistoryEmpty()
Return true if the history list is empty. |
boolean |
isRedoEmpty()
Return true if the redo list is empty. |
protected void |
redo()
Redo the previous action, if any. |
protected void |
undo()
Undo the previous action, if any. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionManager()
Method Detail |
---|
public void invokeAction(IAction action)
public boolean isHistoryEmpty()
public boolean isRedoEmpty()
protected void addToHistory(IAction action)
protected IStack createStack()
IStack
object.
protected IAction getHistoryAction(int index)
protected int getHistorySize()
protected int getRedoSize()
protected void redo()
protected void undo()
|
||||||||||
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 |