예제 #1
0
    def write_to_file(self):
        config = Config.get()

        config.properties.update({
            'username': self.usernameEdit.text(),
            'board_width': self.board_width.value(),
            'board_height': self.board_height.value(),
            'rock_count': self.rock_count.value(),
            'diamond_count': self.diamond_count.value()
        })

        config.save()
예제 #2
0
    def write_to_file(self):
        config = Config.get()

        config.properties.update({
            'username': self.usernameEdit.text(),
            'board_width': self.board_width.value(),
            'board_height': self.board_height.value(),
            'rock_count': self.rock_count.value(),
            'diamond_count': self.diamond_count.value()
        })

        config.save()
예제 #3
0
 def __init__(self, parent, image_repository):
     super(Board, self).__init__(parent)
     self.started = True
     self.paused = False
     self.image_repository = image_repository
     self.config = Config.get()
     self.size = 50
     self.grid = Grid.random(self.config.properties['board_width'], self.config.properties['board_height'],
                             self.config.properties['rock_count'], self.config.properties['diamond_count'])
     self.game_state = GameState(self.grid, self.grid.cells[1][1], self)
     for x in range(self.grid.width):
         for y in range(self.grid.height):
             self.grid.cells[x][y].game_state = self.game_state
     self.initUI()
     self.timer = QtCore.QTimer()
     self.timer.timeout.connect(self.update_game)
     self.timer.start(100)
예제 #4
0
 def __init__(self, parent, image_repository):
     super(Board, self).__init__(parent)
     self.started = True
     self.paused = False
     self.image_repository = image_repository
     self.config = Config.get()
     self.size = 50
     self.grid = Grid.random(self.config.properties['board_width'],
                             self.config.properties['board_height'],
                             self.config.properties['rock_count'],
                             self.config.properties['diamond_count'])
     self.game_state = GameState(self.grid, self.grid.cells[1][1], self)
     for x in range(self.grid.width):
         for y in range(self.grid.height):
             self.grid.cells[x][y].game_state = self.game_state
     self.initUI()
     self.timer = QtCore.QTimer()
     self.timer.timeout.connect(self.update_game)
     self.timer.start(100)
예제 #5
0
 def write_default_options(self):
     Config.get().destroy()
예제 #6
0
 def write_default_options(self):
     Config.get().destroy()