def start(self):
        DistributedWeatherMGRAI.start(self)

        # set AI's initial time, then allow update to change this...
        self.air.setHour(self.currentHour)

        # start the ticking process
        taskMgr.doMethodLater(self.interval, self.update, 'time-update')
 def announceGenerate(self):
     DistributedWeatherMGRAI.announceGenerate(self)
     if self.zoneId in (3000, 3100, 3200, 3300):
         rainState = 'Snow'
     else:
         rainState = 'Rain'
     Sequence(Func(self.b_setState, 'Sunny'), Wait(1800),
              Func(self.b_setState, rainState), Wait(900)).loop()
Пример #3
0
    def announceGenerate(self):
        DistributedWeatherMGRAI.announceGenerate(self)

        # send update to start initial hour
        self.d_update(self.currentHour)

        # set AI's initial time, then allow update to change this...
        self.air.setHour(self.currentHour)

        # start the ticking process
        taskMgr.doMethodLater(self.interval, self.update, 'time-update')
 def announceGenerate(self):
     DistributedWeatherMGRAI.announceGenerate(self)
     if self.zoneId in [3000, 3100, 3200, 3300]:
         rainState = 'Snow'
     #elif self.zoneId == 6000:
     #    self.b_setState('ThunderStorm')
     #    return            
     else:
         rainState = 'Rain'
     Sequence(
         Func(self.b_setState, 'Sunny'),
         Wait(1800),
         Func(self.b_setState, rainState),
         Wait(900)).loop()
    def start(self, alwaysRain = False):
        DistributedWeatherMGRAI.start(self)
                

        if alwaysRain and not self.wantSnow:
            self.b_setState('Rain')
            
        elif self.wantSnow:
            self.b_setState('Snow')
        else:
            Sequence(
                Func(self.b_setState, 'Sunny'),
                Wait(1800),
                Func(self.b_setState, 'Rain'),
                Wait(900)).loop()
 def __init__(self, air, zoneId):
     DistributedWeatherMGRAI.__init__(self, air)
     self.zoneId = zoneId
    def announceGenerate(self):
        DistributedWeatherMGRAI.announceGenerate(self)

        # send update to start initial hour
        self.d_update(self.currentHour)
 def __init__(self, air):
     DistributedWeatherMGRAI.__init__(self, air)
     self.air = air
     self.interval = 150
     self.currentHour = 0
    def announceGenerate(self):
        DistributedWeatherMGRAI.announceGenerate(self)

        Sequence(Func(self.b_setState, 'Sunny'), Wait(1800),
                 Func(self.b_setState, 'Rain'), Wait(900)).loop()
 def __init__(self, air):
     DistributedWeatherMGRAI.__init__(self, air)
 def __init__(self, air):
     DistributedWeatherMGRAI.__init__(self, air)
     self.wantSnow = True