net.jinx.action.input
Class Action

java.lang.Object
  extended by net.jinx.action.input.Action

public class Action
extends java.lang.Object

Actions are generated by Behaviors in response to variables set in Condition objects. They describe what the Participant a Behavior is attached to should do with itself. Action objects can be re-used from one call to a Behavior's act(Participant, float) method to the next. Participant instances should discard them as soon as their processAction(Action) method has completed, since a given Behavior can be attached to more than one Participant.

API Stability: Beta.


Constructor Summary
Action()
          Constructs a new Action with a name "default" and value 0f.
Action(java.lang.String name, float value)
          Constructs a new Action with the given name and value.
 
Method Summary
 java.lang.String getName()
          Peovides the name of this Action.
 float getValue()
          Provides the value of this Action.
 void setName(java.lang.String name)
          Sets the name of this Action.
 void setValue(float value)
          Sets the value of this Action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Constructs a new Action with a name "default" and value 0f. This is useful when you just want to allocate an Action and then modify it everytime it's needed.


Action

public Action(java.lang.String name,
              float value)
Constructs a new Action with the given name and value.

Parameters:
name - the name of the Action.
value - the value of the Action.
Method Detail

getName

public java.lang.String getName()
Peovides the name of this Action.

Returns:
the name.

setName

public void setName(java.lang.String name)
Sets the name of this Action. This can be used for whatever you need. For example, say the Participant is a vehicle and the Bevahior governing it is a player. Action objects could be generated with the name of the control they're supposed to affect.

Parameters:
name - the name.

getValue

public float getValue()
Provides the value of this Action. This will always be from negetive one to one.

Returns:
the value.

setValue

public void setValue(float value)
Sets the value of this Action. The value given will be clamped between negetive one and one.

Parameters:
value - the value.