| Trees | Index | Help |
|
|---|
| Package svs_simulation :: Package ai_lib :: Module statemachine :: Class StateManager |
|
AgentStateManagerProvides management handlers for parallel state machine.
Based on Sean Riley's example in Game Programming with Python, Charles River Media, 2004.| Method Summary | |
|---|---|
Initialises state manager. | |
Removes all properties for specified state. | |
Returns a dictionary representing the current state in each of the state layers. | |
Return the name of the current state for specified layer. | |
Return the current state for specified layer. | |
Returns a property value for a state. | |
Set specified layer to new state. | |
Sets initial state for agent. | |
Sends an input event. | |
Stores a property value for a state. | |
| Instance Variable Summary | |
|---|---|
| object | agent: agent object to whom state manager applies. |
| dict | currentStates: list of current states. |
| Class Variable Summary | |
|---|---|
| dict | layers: list of layers for parallel state machine. |
| Method Details |
|---|
__init__(self,
agent)
Initialises state manager.
|
clearPropertiesForState(self, stateName)Removes all properties for specified state.
|
getCurrentStates(self)Returns a dictionary representing the current state in each of the state layers. |
getNameForState(self, layerName)Return the name of the current state for specified layer.
|
getState(self, layerName)Return the current state for specified layer.
|
getStateProperty(self, stateName, propertyName)Returns a property value for a state.
|
gotoState(self, newStateName, layerName)Set specified layer to new state.
|
setInitialState(self, stateName, layerName)Sets initial state for agent.
|
setInput(self, input, layerName=None)Sends an input event. Can be sent directly to a specified layer. If layer is not specified, seraches for appropriate layer.
|
setStateProperty(self, stateName, propertyName, propertyValue)Stores a property value for a state.
|
| Instance Variable Details |
|---|
agentagent object to whom state manager applies.
|
currentStateslist of current states.
|
| Class Variable Details |
|---|
layerslist of layers for parallel state machine.
|
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Thu Oct 20 15:30:25 2005 | http://epydoc.sf.net |