Panda3D
Public Member Functions | Public Attributes | Static Public Attributes

ClassicStyle Class Reference

Inheritance diagram for ClassicStyle:
FSM

List of all members.

Public Member Functions

def __init__
def __repr__
def __str__
def cleanup
def defaultEnter
def defaultExit
def defaultFilter
def demand
def enterGreen
def enterRed
def enterYellow
def exitGreen
def exitRed
def exitYellow
def filterOff
def forceTransition
def getCurrentFilter
def getCurrentOrNextState
def getCurrentStateOrTransition
def getStateChangeEvent
def isInTransition
def request
def requestNext
def requestPrev
def setBroadcastStateChanges
def setStateArray

Public Attributes

 defaultTransitions
 fsmLock
 name
 newState
 oldState
 state
 stateArray

Static Public Attributes

tuple notify = DirectNotifyGlobal.directNotify.newCategory("FSM")
int SerialNum = 0

Constructor & Destructor Documentation

def __init__ (   self,
  name 
)

Reimplemented from FSM.


Member Function Documentation

def __repr__ (   self) [inherited]
def __str__ (   self) [inherited]
Print out something useful about the fsm
def cleanup (   self) [inherited]
def defaultEnter (   self,
  args 
) [inherited]
This is the default function that is called if there is no
enterState() method for a particular state name. 
def defaultExit (   self) [inherited]
This is the default function that is called if there is no
exitState() method for a particular state name. 
def defaultFilter (   self,
  request,
  args 
) [inherited]
This is the function that is called if there is no
filterState() method for a particular state name.

This default filter function behaves in one of two modes:

(1) if self.defaultTransitions is None, allow any request
whose name begins with a capital letter, which is assumed to
be a direct request to a particular state.  This is similar to
the old ClassicFSM onUndefTransition=ALLOW, with no explicit
state transitions listed.

(2) if self.defaultTransitions is not None, allow only those
requests explicitly identified in this map.  This is similar
to the old ClassicFSM onUndefTransition=DISALLOW, with an
explicit list of allowed state transitions.

Specialized FSM's may wish to redefine this default filter
(for instance, to always return the request itself, thus
allowing any transition.).

Reimplemented in ToonEyes.

def demand (   self,
  request,
  args 
) [inherited]
Requests a state transition, by code that does not expect
the request to be denied.  If the request is denied, raises a
RequestDenied exception.

Unlike request(), this method allows a new request to be made
while the FSM is currently in transition.  In this case, the
request is queued up and will be executed when the current
transition finishes.  Multiple requests will queue up in
sequence.
def enterGreen (   self)
def enterRed (   self)
def enterYellow (   self)
def exitGreen (   self)
def exitRed (   self)
def exitYellow (   self)
def filterOff (   self,
  request,
  args 
) [inherited]
From the off state, we can always go directly to any other
state.
def forceTransition (   self,
  request,
  args 
) [inherited]
Changes unconditionally to the indicated state.  This
bypasses the filterState() function, and just calls
exitState() followed by enterState().
def getCurrentFilter (   self) [inherited]
def getCurrentOrNextState (   self) [inherited]
def getCurrentStateOrTransition (   self) [inherited]
def getStateChangeEvent (   self) [inherited]
def isInTransition (   self) [inherited]
def request (   self,
  request,
  args 
) [inherited]
Requests a state transition (or other behavior).  The
request may be denied by the FSM's filter function.  If it is
denied, the filter function may either raise an exception
(RequestDenied), or it may simply return None, without
changing the FSM's state.

The request parameter should be a string.  The request, along
with any additional arguments, is passed to the current
filterState() function.  If filterState() returns a string,
the FSM transitions to that state.

The return value is the same as the return value of
filterState() (that is, None if the request does not provoke a
state transition, otherwise it is a tuple containing the name
of the state followed by any optional args.)

If the FSM is currently in transition (i.e. in the middle of
executing an enterState or exitState function), an
AlreadyInTransition exception is raised (but see demand(),
which will queue these requests up and apply when the
transition is complete).
def requestNext (   self,
  args 
) [inherited]
Request the 'next' state in the predefined state array.
def requestPrev (   self,
  args 
) [inherited]
Request the 'previous' state in the predefined state array.
def setBroadcastStateChanges (   self,
  doBroadcast 
) [inherited]
def setStateArray (   self,
  stateArray 
) [inherited]
array of unique states to iterate through

Member Data Documentation

Reimplemented from FSM.

fsmLock [inherited]
name [inherited]
newState [inherited]
tuple notify = DirectNotifyGlobal.directNotify.newCategory("FSM") [static, inherited]
oldState [inherited]
int SerialNum = 0 [static, inherited]
state [inherited]
stateArray [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties