def load(self, filename): data = Data.load(filename) random.setstate(data['random']) self.tiles = data['tiles'] self.initindexes() self.popcache = {}
def update(self): self.sim.update() self._ticks[self._stage] += 1 if self._stage == 0 and self.sim.haslife: if self._peopleticks == 0: data = self.sim.savedata() self._stage += 1 self._ticks += [0] self.sim.loaddata(Data.loaddata(data)) else: self._peopleticks -= 1
def load(self): filename = QFileDialog.getOpenFileName(self._view, 'Load simulation state', '', '*{0}'.format(Data.EXTENSION))[0] if len(filename) > 0: data = Data.load(filename) self.create(data['gridsize']) self._model.loaddata(data) self._view.content.update() self.tick()
def load(self, filename): data = Data.load(filename) random.setstate(data['random']) self._dp = data['dp'] self._build = data['build'] self._splitnum = data['splitnum'] self.tiles = data['tiles'] self._shapes = data['shapes'] self.initindexes() self.dirty = True
def load(self, filename): data = Data.load(filename) self.tiles = data['tiles'] self.erode()
def save(self, filename): Data.save(filename, self.savedata())
def savedata(self): return Data.savedata(random.getstate(), self._grid.size, 0, self.spin, self.cells, self.tilt, None, None, None, self.tiles, self.shapes, self._glaciationt, self.populated, self.agricultural, True, True, False, [], {}, {}, [], {}, {}, [], [])
def load(self, filename): loadt = self._timing.routine('loading state') loadt.start('reading file') self.loaddata(Data.load(filename), loadt) loadt.done()
def savedata(self): return Data.savedata(random.getstate(), self._grid.size, 0, self.spin, self.cells, self.tilt, None, None, None, self.tiles, self.shapes, self._glaciationt, self.populated, self.agricultural, True, True, self._inited, self._species, self._capacity, self._population, self.statecolors, self.boundaries, self._tilespecies, self._languages, self._statespecies)
def savedata(self): return Data.savedata(random.getstate(), self._grid.size, 0, self.spin, self.cells, self.tilt, self._dp, self._build, self._splitnum, self.tiles, self._shapes, 0, {}, set(), self._atmosphereticks, self._lifeticks, False, [], {}, {}, [], {}, {}, [], [])
def load(self, filename): self.loaddata(Data.load(filename))
def load(self, filename): data = Data.load(filename) self.tiles = data['tiles'] self.classify()
def save(self, filename): data = self.sim.savedata() data['stage'] = self._stage data['peoplet'] = self._peopleticks Data.save(filename, data)
def save(self, filename): Data.save(filename, random.getstate(), self._dp, self._build, self._splitnum, self.tiles, self._shapes)