Esempio n. 1
0
    def gotGame(self, data):
        for model_data, id in data:
            # create model objects from the yaml received
            model = loader.fromDict(model_data)
            self.remote_models[model] = id

            # and alert the gui and other listeners that models are 
            # alive and kicking.
            dispatcher.send(signal=New, sender='remote', model=model)

            # start telling the gui about the received object
            model.present()
Esempio n. 2
0
    def gotGame(self, data):
        for model_data, id in data:
            # create model objects from the yaml received
            model = loader.fromDict(model_data)
            self.remote_models[model] = id

            # and alert the gui and other listeners that models are
            # alive and kicking.
            dispatcher.send(signal=New, sender='remote', model=model)

            # start telling the gui about the received object
            model.present()
Esempio n. 3
0
 def loadSavedGame(self):
     loaded = yaml.loadFile(fs.saved).next()
     for id, data in loaded.items():
         model = loader.fromDict(data)
         self.models[model] = id
         dispatcher.send(signal=New, sender='realm', model=model)
         for prop, value in data.items():
             if prop == 'TYPE':
                 continue
             dispatcher.send(signal=model, 
                             sender='realm', 
                             property=prop,
                             old=None, 
                             value=value)
Esempio n. 4
0
 def loadSavedGame(self):
     loaded = yaml.loadFile(fs.saved).next()
     for id, data in loaded.items():
         model = loader.fromDict(data)
         self.models[model] = id
         dispatcher.send(signal=New, sender='realm', model=model)
         for prop, value in data.items():
             if prop == 'TYPE':
                 continue
             dispatcher.send(signal=model,
                             sender='realm',
                             property=prop,
                             old=None,
                             value=value)