Source code for direct.distributed.SampleObject

"""SampleObject module: contains the SampleObject class"""

from direct.directnotify.DirectNotifyGlobal import *
from direct.distributed.DistributedObject import *

[docs]class SampleObject(DistributedObject): notify = directNotify.newCategory("SampleObject")
[docs] def __init__(self, cr): self.cr = cr
# self.red = 0 # self.green = 0 # self.blue = 0
[docs] def setColor(self, red = 0, green = 0, blue = 0): self.red = red self.green = green self.blue = blue self.announceGenerate()
[docs] def getColor(self): return (self.red, self.green, self.blue)