in tutorials/tutorial4/TicTacToe/TicTacToe/TicTacToeInteractor.swift [60:79]
func placeCurrentPlayerMark(atRow row: Int, col: Int) {
guard board[row][col] == nil else {
return
}
let currentPlayer = getAndFlipCurrentPlayer()
board[row][col] = currentPlayer
presenter.setCell(atRow: row, col: col, withPlayerType: currentPlayer)
let endGame = checkEndGame()
if endGame.didEnd {
if let winner = endGame.winner {
mutableScoreStream.updateScore(with: winner)
}
presenter.announce(winner: endGame.winner) {
self.listener?.ticTacToeDidEnd(with: endGame.winner)
}
}
}