Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes

# State Class Reference

Inherits direct::showbase::DirectObject::DirectObject.

List of all members.

## Public Member Functions
def | __init__
def | __str__
def | addChild
def | addTransition
def | enter
def | exit
def | getChildren
def | getEnterFunc
def | getExitFunc
def | getInspectorPos
def | getName
def | getTransitions
def | hasChildren
def | isTransitionDefined
def | removeChild
def | replaceMethod
def | setChildren
def | setEnterFunc
def | setExitFunc
def | setInspectorPos
def | setName
def | setTransitions
def | transitionsToAny
## Static Public Attributes
string | Any = 'ANY'
tuple | notify = directNotify.newCategory("State")
tuple | States = weakref.WeakKeyDictionary()

## Constructor & Destructor Documentation

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

def __str__ | ( |  | self | ) |

def addChild | ( |  | self,
|  |  | ClassicFSM
| ) |  |

    Add the given ClassicFSM to list of child FSMs

def addTransition | ( |  | self,
|  |  | transition
| ) |  |

    addTransitions(self, string)

def enter | ( |  | self,
|  |  | argList = `[]`
| ) |  |

    Call the enter function for this state

def exit | ( |  | self,
|  |  | argList = `[]`
| ) |  |

    Call the exit function for this state

def getChildren | ( |  | self | ) |

    Return the list of child FSMs

def getEnterFunc | ( |  | self | ) |

def getExitFunc | ( |  | self | ) |

def getInspectorPos | ( |  | self | ) |

    getInspectorPos(self)

def getName | ( |  | self | ) |

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()

def hasChildren | ( |  | self | ) |

    Return true if state has child FSMs

def isTransitionDefined | ( |  | self,
|  |  | otherState
| ) |  |

def removeChild | ( |  | self,
|  |  | ClassicFSM
| ) |  |

    Remove the given ClassicFSM from list of child FSMs

def replaceMethod | ( |  | self,
|  |  | oldFunction,
|  |  | newFunction
| ) |  |

def setChildren | ( |  | self,
|  |  | FSMList
| ) |  |

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

def setEnterFunc | ( |  | self,
|  |  | stateEnterFunc
| ) |  |

def setExitFunc | ( |  | self,
|  |  | stateExitFunc
| ) |  |

def setInspectorPos | ( |  | self,
|  |  | inspectorPos
| ) |  |

    setInspectorPos(self, [x, y])

def setName | ( |  | self,
|  |  | stateName
| ) |  |

def setTransitions | ( |  | self,
|  |  | stateTransitions
| ) |  |

    setTransitions(self, string[])

def transitionsToAny | ( |  | self | ) |

    returns true if State defines transitions to any other state

## Member Data Documentation

string Any = 'ANY'`[static]`

tuple notify = directNotify.newCategory("State")`[static]`

tuple States = weakref.WeakKeyDictionary()`[static]`

All Classes Namespaces Functions Variables Enumerations Enumerator Properties