def __init__(self, pet): CPetBrain.__init__(self) self.pet = pet self.focus = None self.started = 0 self.inMovie = 0 self.chaseNode = self.pet.getRender().attachNewNode('PetChaseNode') # create our goal manager self.goalMgr = PetGoalMgr.PetGoalMgr(self.pet) # dict of doId to goals related to that doId self.doId2goals = {} # dict of nearby avatars self.nearbyAvs = {} # dict of doId:None of avatars that we are aware of and have goals for self.avAwareness = {} # dict of toon avIds we are aware of to timestamp of last interaction. # This is here to let the pet know that he shouldn't run away when # a Toon is doing things with him. self.lastInteractTime = {} # work through nearby avs linearly rather than call random.choice, # for speed self.nextAwarenessIndex = 0 if __dev__: self.pscPrior = PStatCollector( 'App:Show code:petThink:UpdatePriorities') self.pscAware = PStatCollector( 'App:Show code:petThink:ShuffleAwareness') self.pscResc = PStatCollector('App:Show code:petThink:Reschedule')
def __init__(self, pet): self.pet = pet self.focus = None self.started = 0 self.inMovie = 0 self.chaseNode = self.pet.getRender().attachNewNode('PetChaseNode') self.goalMgr = PetGoalMgr.PetGoalMgr(self.pet) self.doId2goals = {} self.nearbyAvs = {} self.avAwareness = {} self.lastInteractTime = {} self.nextAwarenessIndex = 0
def __init__(self, pet): self.pet = pet self.focus = None self.started = 0 self.inMovie = 0 self.chaseNode = self.pet.getRender().attachNewNode('PetChaseNode') self.goalMgr = PetGoalMgr.PetGoalMgr(self.pet) self.doId2goals = {} self.nearbyAvs = {} self.avAwareness = {} self.lastInteractTime = {} self.nextAwarenessIndex = 0 if __dev__: self.pscPrior = PStatCollector('App:Show code:petThink:UpdatePriorities') self.pscAware = PStatCollector('App:Show code:petThink:ShuffleAwareness') self.pscResc = PStatCollector('App:Show code:petThink:Reschedule')