Panda3D
Public Member Functions | Static Public Attributes | List of all members
State Class Reference
Inheritance diagram for State:
DirectObject

Public Member Functions

def __init__ (self, name, enterFunc=None, exitFunc=None, transitions=Any, inspectorPos=[])
 
def __str__ (self)
 
def addChild (self, ClassicFSM)
 
def addTransition (self, transition)
 
def enter (self, argList=[])
 
def exit (self, argList=[])
 
def getChildren (self)
 
def getEnterFunc (self)
 
def getExitFunc (self)
 
def getInspectorPos (self)
 
def getName (self)
 
def getTransitions (self)
 
def hasChildren (self)
 
def isTransitionDefined (self, otherState)
 
def removeChild (self, ClassicFSM)
 
def replaceMethod (self, oldFunction, newFunction)
 
def setChildren (self, FSMList)
 
def setEnterFunc (self, stateEnterFunc)
 
def setExitFunc (self, stateExitFunc)
 
def setInspectorPos (self, inspectorPos)
 
def setName (self, stateName)
 
def setTransitions (self, stateTransitions)
 
def transitionsToAny (self)
 
- Public Member Functions inherited from DirectObject
def __init__ (self)
 
def accept (self, event, method, extraArgs=[])
 
def acceptOnce (self, event, method, extraArgs=[])
 
def addTask (self, *args, **kwargs)
 
def detectLeaks (self)
 
def doMethodLater (self, *args, **kwargs)
 
def getAllAccepting (self)
 
def ignore (self, event)
 
def ignoreAll (self)
 
def isAccepting (self, event)
 
def isIgnoring (self, event)
 
def removeAllTasks (self)
 
def removeTask (self, taskOrName)
 

Static Public Attributes

string Any = 'ANY'
 
 notify = directNotify.newCategory("State")
 
 States = weakref.WeakKeyDictionary()
 
- Static Public Attributes inherited from DirectObject
def accept_once = acceptOnce
 
def add_task = addTask
 
def detect_leaks = detectLeaks
 
def do_method_later = doMethodLater
 
def get_all_accepting = getAllAccepting
 
def ignore_all = ignoreAll
 
def is_accepting = isAccepting
 
def is_ignoring = isIgnoring
 
def remove_all_tasks = removeAllTasks
 
def remove_task = removeTask
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  enterFunc = None,
  exitFunc = None,
  transitions = Any,
  inspectorPos = [] 
)
__init__(self, string, func, func, string[], inspectorPos = [])
State constructor: takes name, enter func, exit func, and
a list of states it can transition to (or State.Any).

Member Function Documentation

◆ __str__()

def __str__ (   self)

◆ addChild()

def addChild (   self,
  ClassicFSM 
)
Add the given ClassicFSM to list of child FSMs

◆ addTransition()

def addTransition (   self,
  transition 
)
addTransitions(self, string)

◆ enter()

def enter (   self,
  argList = [] 
)
Call the enter function for this state

◆ exit()

def exit (   self,
  argList = [] 
)
Call the exit function for this state

◆ getChildren()

def getChildren (   self)
Return the list of child FSMs

◆ getEnterFunc()

def getEnterFunc (   self)

◆ getExitFunc()

def getExitFunc (   self)

◆ getInspectorPos()

def getInspectorPos (   self)
getInspectorPos(self)

◆ getName()

def getName (   self)

◆ getTransitions()

def getTransitions (   self)
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()

def hasChildren (   self)
Return true if state has child FSMs

◆ isTransitionDefined()

def isTransitionDefined (   self,
  otherState 
)

◆ removeChild()

def removeChild (   self,
  ClassicFSM 
)
Remove the given ClassicFSM from list of child FSMs

◆ replaceMethod()

def replaceMethod (   self,
  oldFunction,
  newFunction 
)

◆ setChildren()

def setChildren (   self,
  FSMList 
)
setChildren(self, ClassicFSM[])
Set the children to given list of FSMs

◆ setEnterFunc()

def setEnterFunc (   self,
  stateEnterFunc 
)

◆ setExitFunc()

def setExitFunc (   self,
  stateExitFunc 
)

◆ setInspectorPos()

def setInspectorPos (   self,
  inspectorPos 
)
setInspectorPos(self, [x, y])

◆ setName()

def setName (   self,
  stateName 
)

◆ setTransitions()

def setTransitions (   self,
  stateTransitions 
)
setTransitions(self, string[])

◆ transitionsToAny()

def transitionsToAny (   self)
returns true if State defines transitions to any other state 

Member Data Documentation

◆ Any

string Any = 'ANY'
static

◆ notify

notify = directNotify.newCategory("State")
static

◆ States

States = weakref.WeakKeyDictionary()
static