rails.game.action
Class PossibleActions
java.lang.Object
rails.game.action.PossibleActions
public class PossibleActions
- extends java.lang.Object
This class manages the actions that the current user can execute at any point
in time. Each possible action is represented by an instance of a subclass of
PossibleAction. The complete set is stored in aan ArrayList.
This class is implemented as a singleton to prevent multiple
instances lingering around, as there can only be one set of possible actions
at any point in time.
- Author:
- Erik Vos
Field Summary |
protected static org.apache.log4j.Logger |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.apache.log4j.Logger log
getInstance
public static PossibleActions getInstance()
clear
public void clear()
add
public void add(PossibleAction action)
remove
public void remove(PossibleAction action)
addAll
public void addAll(java.util.List<? extends PossibleAction> actions)
contains
public boolean contains(java.lang.Class<? extends PossibleAction> clazz)
getType
public <T extends PossibleAction> java.util.List<T> getType(java.lang.Class<T> clazz)
getList
public java.util.List<PossibleAction> getList()
isEmpty
public boolean isEmpty()
containsOnlyPass
public boolean containsOnlyPass()
validate
public boolean validate(PossibleAction checkedAction)
- Check if a given action exists in the current list of possible actions