mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
minor API refinements
This commit is contained in:
parent
293b6cd493
commit
e3e37d3bba
@ -125,14 +125,6 @@ class FSM(DirectObject.DirectObject):
|
||||
|
||||
SerialNum = 0
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
self._serialNum = FSM.SerialNum
|
||||
FSM.SerialNum += 1
|
||||
self._broadcastStateChanges = False
|
||||
# Initially, we are in the Off state by convention.
|
||||
self.state = 'Off'
|
||||
|
||||
# This member lists the default transitions that are accepted
|
||||
# without question by the defaultFilter. It's a map of state
|
||||
# names to a list of legal target state names from that state.
|
||||
@ -143,7 +135,15 @@ class FSM(DirectObject.DirectObject):
|
||||
# a capital letter) are allowed. If it is set to an empty
|
||||
# map, no transitions are implicitly allowed--all transitions
|
||||
# must be approved by some filter function.
|
||||
self.defaultTransitions = None
|
||||
defaultTransitions = None
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
self._serialNum = FSM.SerialNum
|
||||
FSM.SerialNum += 1
|
||||
self._broadcastStateChanges = False
|
||||
# Initially, we are in the Off state by convention.
|
||||
self.state = 'Off'
|
||||
|
||||
# This member records transition requests made by demand() or
|
||||
# forceTransition() while the FSM is in transition between
|
||||
@ -259,7 +259,7 @@ class FSM(DirectObject.DirectObject):
|
||||
if isinstance(result, types.StringTypes):
|
||||
# If the return value is a string, it's just the name
|
||||
# of the state. Wrap it in a tuple for consistency.
|
||||
result = (result,)
|
||||
result = (result,) + args
|
||||
|
||||
# Otherwise, assume it's a (name, *args) tuple
|
||||
self.__setState(*result)
|
||||
|
Loading…
x
Reference in New Issue
Block a user