| 180 | |
| 181 | |
| 182 | class NimController(object): |
| 183 | |
| 184 | def __init__(self, game): |
| 185 | self.game = game |
| 186 | self.sticks = game.view.sticks |
| 187 | self.BUSY = False |
| 188 | for stick in self.sticks.values(): |
| 189 | stick.onclick(stick.makemove) |
| 190 | self.game.screen.onkey(self.game.model.setup, "space") |
| 191 | self.game.screen.onkey(self.game.view.clear, "Escape") |
| 192 | self.game.view.display("Press space bar to start game") |
| 193 | self.game.screen.listen() |
| 194 | |
| 195 | def notify_move(self, row, col): |
| 196 | if self.BUSY: |
| 197 | return |
| 198 | self.BUSY = True |
| 199 | self.game.model.notify_move(row, col) |
| 200 | self.BUSY = False |
| 201 | |
| 202 | |
| 203 | class Nim(object): |
no outgoing calls
no test coverage detected
searching dependent graphs…