(self, cell)
| 232 | self.dialog.show(self) |
| 233 | |
| 234 | def fill_void_cells(self, cell): |
| 235 | checked_cells = [cell, ] |
| 236 | while len(checked_cells) > 0: |
| 237 | for cell in checked_cells[:]: |
| 238 | checked_cells.remove(cell) |
| 239 | if (not self.mine_matrix[cell.y][cell.x].has_mine) and \ |
| 240 | (self.mine_matrix[cell.y][cell.x].nearest_mine == 0): |
| 241 | for coord in [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]: |
| 242 | _x, _y = coord |
| 243 | if not self.coord_in_map(cell.x + _x, cell.y + _y): |
| 244 | continue |
| 245 | |
| 246 | if not self.mine_matrix[cell.y + _y][cell.x + _x].opened: |
| 247 | self.mine_matrix[cell.y + _y][cell.x + _x].check_mine(None, False) |
| 248 | checked_cells.append(self.mine_matrix[cell.y + _y][cell.x + _x]) |
| 249 | |
| 250 | def explosion(self, cell): |
| 251 | print("explosion") |
no test coverage detected