Esempio n. 1
0
        def it_can_undo_last_move_or_push(self, forward_mover):
            src = index_1d(4, 2, forward_mover.board.width)
            dest = index_1d(3, 2, forward_mover.board.width)

            forward_mover.move(Direction.LEFT)
            forward_mover.undo()

            assert forward_mover.state.pusher_position(DEFAULT_PIECE_ID) == src
            assert forward_mover.board[src].has_pusher == True
            assert forward_mover.board[dest].has_pusher == False
Esempio n. 2
0
 def it_can_undo_last_pusher_selection(self, forward_mover):
     assert forward_mover.selected_pusher == DEFAULT_PIECE_ID
     forward_mover.selected_pusher = DEFAULT_PIECE_ID + 1
     forward_mover.undo()
     assert forward_mover.selected_pusher == DEFAULT_PIECE_ID