|
Panda3D
|
Public Member Functions | |
| __init__ (self, name, subEvents=None, doneEvent=None) | |
| __repr__ (self) | |
| addEvent (self, eventName) | |
| destroy (self) | |
| getDoneEvent (self) | |
| getName (self) | |
| isCompleted (self) | |
| newEvent (self, name) | |
Public Member Functions inherited from DirectObject | |
| __init__ (self) | |
| accept (self, event, method, extraArgs=[]) | |
| acceptOnce (self, event, method, extraArgs=[]) | |
| addTask (self, *args, **kwargs) | |
| detectLeaks (self) | |
| doMethodLater (self, *args, **kwargs) | |
| getAllAccepting (self) | |
| ignore (self, event) | |
| ignoreAll (self) | |
| isAccepting (self, event) | |
| isIgnoring (self, event) | |
| removeAllTasks (self) | |
| removeTask (self, taskOrName) | |
Protected Member Functions | |
| _signalComplete (self) | |
| _subEventComplete (self, subEventName, *args, **kwArgs) | |
Protected Member Functions inherited from DirectObject | |
| _addTask (self, task) | |
| _clearTask (self, task) | |
Protected Attributes | |
| bool | _completed = False |
| _completedEvents = set() | |
| _doneEvent = doneEvent | |
| _name = name | |
| _subEventComplete | |
| _subEvents = set() | |
Protected Attributes inherited from DirectObject | |
| dict | _taskList = {} |
Static Protected Attributes | |
| _SerialNumGen = SerialNumGen() | |
Additional Inherited Members | |
Static Public Attributes inherited from DirectObject | |
| accept_once = acceptOnce | |
| add_task = addTask | |
| detect_leaks = detectLeaks | |
| do_method_later = doMethodLater | |
| get_all_accepting = getAllAccepting | |
| ignore_all = ignoreAll | |
| is_accepting = isAccepting | |
| is_ignoring = isIgnoring | |
| remove_all_tasks = removeAllTasks | |
| remove_task = removeTask | |
This class allows you to group together multiple events and treat them as a single event. The EventGroup will not send out its event until all of its sub-events have occured.
| __init__ | ( | self, | |
| name, | |||
| subEvents = None, | |||
| doneEvent = None ) |
Provide a meaningful name to aid debugging.
doneEvent is optional. If not provided, a unique done event will be
generated and is available as EventGroup.getDoneEvent().
Examples:
# waits for gotRed and gotBlue, then sends out 'gotColors'
EventGroup('getRedAndBlue', ('gotRed', 'gotBlue'), doneEvent='gotColors')
# waits for two interests to close, then calls self._handleBothInterestsClosed()
# uses EventGroup.getDoneEvent() and EventGroup.newEvent() to generate unique,
# disposable event names
eGroup = EventGroup('closeInterests')
self.acceptOnce(eGroup.getDoneEvent(), self._handleBothInterestsClosed)
base.cr.closeInterest(interest1, event=eGroup.newEvent('closeInterest1'))
base.cr.closeInterest(interest2, event=eGroup.newEvent('closeInterest2'))
| __repr__ | ( | self | ) |
|
protected |
|
protected |
| addEvent | ( | self, | |
| eventName ) |
Adds a new event to the list of sub-events that we're waiting on. Returns the name of the event.
| destroy | ( | self | ) |
| getDoneEvent | ( | self | ) |
| getName | ( | self | ) |
| isCompleted | ( | self | ) |
| newEvent | ( | self, | |
| name ) |
Pass in an event name and it will be unique-ified for you and added to this EventGroup. TIP: there's no need to repeat information in this event name that is already in the name of the EventGroup object. Returns the new event name.
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |