Public Member Functions | List of all members
AnfaPhasedObject Class Reference
Inheritance diagram for AnfaPhasedObject:

Public Member Functions

def __init__ (self)
def loadPhaseAt (self)
def loadPhaseAway (self)
def loadPhaseFar (self)
def loadPhaseNear (self)
def unloadPhaseAt (self)
def unloadPhaseAway (self)
def unloadPhaseFar (self)
def unloadPhaseNear (self)
- Public Member Functions inherited from PhasedObject
def __init__ (self, aliasMap={})
def __repr__ (self)
def __str__ (self)
def cleanup (self)
def getAliasPhase (self, alias)
def getPhase (self)
def getPhaseAlias (self, phase)
def setAlias (self, phase, alias)
def setPhase (self, aPhase)

Additional Inherited Members

- Public Attributes inherited from PhasedObject
- Static Public Attributes inherited from PhasedObject
 notify = directNotify.newCategory("PhasedObject")

Detailed Description

This is an example class to demonstrate the concept of
alias mapping for PhasedObjects.

As the distance between an observer and this object closes,
we would set the phase level succesively higher, with an initial
phase of 'Away' being set in __init__:

setPhase('Far') -> invokes loadPhaseFar()
setPhase('Near') -> invokes loadPhaseNear()

Now let's say the objects start moving away from each other:

setPhase('Far') -> invokes unloadPhaseNear()
setPhase('Away') -> invokes unloadPhaseFar()

Now one object teleports to the other:

setPhase('At') -> invokes loadPhase('Far'),
                  then    loadPhase('Near'),
                  then    loadPhase('At')

Now the phased object is destroyed, we must clean it up
before removal:

cleanup() -> invokes unloadPhase('At')
             then    unloadPhase('Near')
             then    unloadPhase('Far')
             then    unloadPhase('Away')

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Member Function Documentation

◆ loadPhaseAt()

def loadPhaseAt (   self)

◆ loadPhaseAway()

def loadPhaseAway (   self)

◆ loadPhaseFar()

def loadPhaseFar (   self)

◆ loadPhaseNear()

def loadPhaseNear (   self)

◆ unloadPhaseAt()

def unloadPhaseAt (   self)

◆ unloadPhaseAway()

def unloadPhaseAway (   self)

◆ unloadPhaseFar()

def unloadPhaseFar (   self)

◆ unloadPhaseNear()

def unloadPhaseNear (   self)