direct.fsm.FourState¶
from direct.fsm.FourState import FourState
Contains the FourState class.
Inheritance diagram
digraph inheritancecf21975b63 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "FourState" [URL="direct.fsm.FourState.html#direct.fsm.FourState.FourState",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Generic four state ClassicFSM base class."]; }- class FourState(names, durations=[0, 1, None, 1, 1])[source]¶
Bases:
objectGeneric four state ClassicFSM base class.
This is a mix-in class that expects that your derived class is a DistributedObject.
Inherit from FourStateFSM and pass in your states. Two of the states should be oposites of each other and the other two should be the transition states between the first two. E.g:
+--------+ -->| closed | -- | +--------+ | | | | v +---------+ +---------+ | closing |<----->| opening | +---------+ +---------+ ^ | | | | +------+ | ----| open |<--- +------+
There is a fifth off state, but that is an implementation detail (and that’s why it’s not called a five state ClassicFSM).
I found that this pattern repeated in several things I was working on, so this base class was created.
- notify = <direct.directnotify.Notifier.Notifier object>¶