Ejemplo 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()
Ejemplo 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()
Ejemplo 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)
Ejemplo 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)