mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
patch from panda community member Sergey Shepelev
This commit is contained in:
parent
652ca28703
commit
adf9da20bc
@ -161,6 +161,18 @@ class FSM(DirectObject):
|
|||||||
import weakref
|
import weakref
|
||||||
_debugFsms[name]=weakref.ref(self)
|
_debugFsms[name]=weakref.ref(self)
|
||||||
|
|
||||||
|
def __getattr__(self, name):
|
||||||
|
"""Provides request_State(*args) alias to request('State', *args)
|
||||||
|
and demand_State(*args) alias to demand('State', *args)."""
|
||||||
|
|
||||||
|
if name.startswith('request_'):
|
||||||
|
return lambda *args, **kwargs: self.request(name[8:], *args, **kwargs)
|
||||||
|
if name.startswith('demand_'):
|
||||||
|
return lambda *args, **kwargs: self.request(name[7:], *args, **kwargs)
|
||||||
|
if name in self.__dict__:
|
||||||
|
return self.__dict__[name]
|
||||||
|
raise AttributeError(name)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
# A convenience function to force the FSM to clean itself up
|
# A convenience function to force the FSM to clean itself up
|
||||||
# by transitioning to the "Off" state.
|
# by transitioning to the "Off" state.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user