net.nexttext.behaviour
Class Action.ActionResult

java.lang.Object
  extended by net.nexttext.behaviour.Action.ActionResult
Enclosing interface:
Action

public static class Action.ActionResult
extends java.lang.Object

Used to communicate results of Action.behave().


Field Summary
 boolean canComplete
          Indicate if the Action can ever complete for this object.
 boolean complete
          Indicate that the action has completed.
 boolean event
          Indicate that an event occured in this step.
 
Constructor Summary
Action.ActionResult()
          Create an action result suitable for use in combine().
Action.ActionResult(boolean complete, boolean canComplete, boolean event)
           
 
Method Summary
 void combine(Action.ActionResult ar)
          Combine multiple ActionResults into a single one.
 Action.ActionResult endCombine()
          Ends the combining of several ActionResults, so it can be returned.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

complete

public boolean complete
Indicate that the action has completed.


canComplete

public boolean canComplete
Indicate if the Action can ever complete for this object.


event

public boolean event
Indicate that an event occured in this step.

Constructor Detail

Action.ActionResult

public Action.ActionResult(boolean complete,
                           boolean canComplete,
                           boolean event)

Action.ActionResult

public Action.ActionResult()
Create an action result suitable for use in combine().

Method Detail

combine

public void combine(Action.ActionResult ar)
Combine multiple ActionResults into a single one.

Sometimes multiple ActionResults need to be combined. For example Multiplexer calls several actions, but can only return a single result. Use the default constructor to start the combination process, use this method to process each ActionResult to combine, and use endCombine when they have all been combined.

The resulting ActionResult is set using these rules:


endCombine

public Action.ActionResult endCombine()
Ends the combining of several ActionResults, so it can be returned.

This step is necessary because what is returned depends on whether any of the actions set canComplete.

Returns:
this