direct.fsm.State

from direct.fsm.State import State

State module: contains State class

Inheritance diagram

Inheritance diagram of direct.fsm.State

class State(name, enterFunc=None, exitFunc=None, transitions='ANY', inspectorPos=[])[source]

Bases: direct.showbase.DirectObject.DirectObject

Any = 'ANY'
States = <WeakKeyDictionary>
__init__(self, string, func, func, string[], inspectorPos = [])[source]

State constructor: takes name, enter func, exit func, and a list of states it can transition to (or State.Any).

addChild(self, ClassicFSM)[source]

Add the given ClassicFSM to list of child FSMs

addTransition(self, transition)[source]

addTransitions(self, string)

enter(self, argList=[])[source]

Call the enter function for this state

exit(self, argList=[])[source]

Call the exit function for this state

getChildren(self)[source]

Return the list of child FSMs

getEnterFunc(self)[source]
getExitFunc(self)[source]
getInspectorPos(self)[source]
getName(self)[source]
getTransitions(self)[source]

warning – if the state transitions to any other state, returns an empty list (falsely implying that the state has no transitions) see State.transitionsToAny()

hasChildren(self)[source]

Return true if state has child FSMs

isTransitionDefined(self, otherState)[source]
notify = <direct.directnotify.Notifier.Notifier object>
removeChild(self, ClassicFSM)[source]

Remove the given ClassicFSM from list of child FSMs

replaceMethod(oldFunction, newFunction)[source]
setChildren(self, ClassicFSM[])[source]

Set the children to given list of FSMs

setEnterFunc(self, stateEnterFunc)[source]
setExitFunc(self, stateExitFunc)[source]
setInspectorPos(self[, x, y])[source]
setName(self, stateName)[source]
setTransitions(self, string[])[source]
transitionsToAny(self)[source]

returns true if State defines transitions to any other state

weakref = <module 'weakref' from '/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/weakref.py'>