Analytical Perspectives in Game Design


 

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.smf.ContinuousLinearStateModel

java.lang.Object
   |
   +----bvyy.smf.StateMachine
           |
           +----bvyy.smf.ContinuousLinearStateModel

public class ContinuousLinearStateModel
extends StateMachine
This class is provides an "infinitely" variable linear state model. In all respects it is the respects is is the same as a Discrte Linear State Model.

Version:
0.0.1 21 June 1998
Author:
(c)1998 Brian Voon Yee Yap
See Also:
DiscreteLinearStateModel

Constructor Index

 o ContinuousLinearStateModel()
 o ContinuousLinearStateModel(String)
Construct a state machine.

Method Index

 o fireStateChange(ModifiableChangeEvent)
Change the state from the current state to a new state.
 o getDefaultValue()
Get the default value.
 o getDownVerb()
Gets the down verb.
 o getMax()
Get maximum value
 o getMin()
Get minimum value
 o getState()
Returns the current state of the state machine in a StringTokenizer.
 o getStateTransitions()
Gets the states that can be reached from the current state.
 o getUpVerb()
Gets the up verb.
 o setDefaultValue(float)
Set the default value.
 o setDownVerb(String)
Sets the down verb.
 o setMax(float)
Set maximum value.
 o setMin(float)
Set minimum value.

If the current value, or default values are less than the new minimum they will be set to the new minimum.

 o setUpVerb(String)
Sets the up verb.

Constructors

 o ContinuousLinearStateModel
 public ContinuousLinearStateModel()
 o ContinuousLinearStateModel
 public ContinuousLinearStateModel(String spec)
Construct a state machine.

This method is synchronised to prevent conflicts from other clients who might want to update the state of this machine. They will have to wait until after the object is created.

Parameters:
spec - The format of the input token shall be:
  • LSM,[major version],[minor version]
  • name
  • defaultvalue
  • maxValue
  • minvalue
  • upVerb
  • downVerb
The delimeter is |.

Methods

 o fireStateChange
 public void fireStateChange(ModifiableChangeEvent newState) throws PropertyVetoException
Change the state from the current state to a new state. If the state request is not possible then no transition happens. This might happen in a multi-user game where another user has acted just before this user.

Modifiers are not implemented in this version.

Parameters:
newState - is a property change event. The old and new value objects should be string objects.
Throws: PropertyVetoException
thrown if a vetoable listener vetoes the change.
Overrides:
fireStateChange in class StateMachine
 o getState
 public String getState()
Returns the current state of the state machine in a StringTokenizer.

The format of the StringTokenizer is:

  • myName,[major version],[minor version]
  • myvalue

Overrides:
getState in class StateMachine
 o getStateTransitions
 public String getStateTransitions()
Gets the states that can be reached from the current state. A StringTokenizer of new states is returned.

The format of the StringTokenizer is:

  • LSM,[major version],[minor version]
  • name
  • currentvalue
  • maxValue
  • minvalue
  • upVerb
  • downVerb
The delimeter is "|".

Overrides:
getStateTransitions in class StateMachine
 o setDefaultValue
 public void setDefaultValue(float newDefault)
Set the default value.

Parameters:
newDefault - The default is set to this value unless it is outside the maximum or minimum value. The it is set to the maximum or minimum value.
 o getDefaultValue
 public float getDefaultValue()
Get the default value.

 o setMax
 public void setMax(float newMax)
Set maximum value.

If the current value, or default values are greater than the new maximum they will be set to the new maximum. This in turn will fire any necessary validations. If this change is voided, then nothing is done.

If the maxvalue is below the minimum value then the maximum value will be set to the minimum value.

Parameters:
newMax - The new maximum value.
 o getMax
 public float getMax()
Get maximum value

 o setMin
 public void setMin(float newMin)
Set minimum value.

If the current value, or default values are less than the new minimum they will be set to the new minimum. This in turn will fire any necessary validations. If this change is voided, then nothing is done.

If you attempt to set the minimum above the maximum, it will be set to the maximum.

Parameters:
newMin - The new minimum value.
 o getMin
 public float getMin()
Get minimum value

 o setUpVerb
 public void setUpVerb(String newUpVerb)
Sets the up verb.

Parameters:
newUpVerb - the new verb.
 o getUpVerb
 public String getUpVerb()
Gets the up verb.

 o setDownVerb
 public void setDownVerb(String newDownVerb)
Sets the down verb.

Parameters:
newDownVerb - the new verb.
 o getDownVerb
 public String getDownVerb()
Gets the down verb.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

22/11/99

 


See also: [Role Playing Games] [Game Engine]
© 1998, 1999 Brian Yap. These pages are available under the GNU licence.