|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.tudelft.goal.ut2004.actions.Action
public abstract class Action
Basic class for actions executed by the UT2004BotBehavior
. Before
actions are executed they are are queued up in the ActionQueue
. To
ensure the queue does not overflow the ActionQueue checks which actions can
replace other actions in the queue and if this action would have any effect.
Actions can be replaced when executing this action after them would have no
effect. This is indicated by using the setReplaces(Class...)
method.
Actions have no effect if there is an action in the queue which prevents this
action from having any effect. this is indicated by using the
setBlockedBy(Class...)
.
Constructor Summary | |
---|---|
Action()
|
Method Summary | |
---|---|
abstract void |
execute()
|
boolean |
hasEffect(Action action)
Returns true if executing the argument action does not impede the execution of this action. |
boolean |
replaces(Action action)
Returns true if executing the argument action before this action will have no effect. |
void |
setBlockedBy(Class<? extends Action>... blocks)
Sets which actions will prevent this action from having any effect if executed after them. |
void |
setReplaces(Class<? extends Action>... replaces)
Sets which actions will have no effect if this action is executed after them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Action()
Method Detail |
---|
public abstract void execute() throws cz.cuni.amis.utils.exception.PogamutException
cz.cuni.amis.utils.exception.PogamutException
public void setReplaces(Class<? extends Action>... replaces)
replaces
- public boolean replaces(Action action)
action
-
public void setBlockedBy(Class<? extends Action>... blocks)
blocks
- public boolean hasEffect(Action action)
action
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |