Fix(master): bug de condition de victoire

master
Louis DUFOUR 9 months ago
parent e922f48980
commit ac945d08fd

@ -218,13 +218,6 @@ public struct VerySimpleRules: Rules {
return (true, .winner(lastMove.owner, .denReached))
}
// Vérifie si l'un des joueurs a atteint la tanière de l'adversaire
let player1ReachedOpponentDen = board.grid[0][4].piece?.owner == .player1
let player2ReachedOpponentDen = board.grid[4][0].piece?.owner == .player2
if player1ReachedOpponentDen || player2ReachedOpponentDen {
return (true, .winner(player1ReachedOpponentDen ? .player1 : .player2, .denReached))
}
// Vérifie si l'un des joueurs n'a plus de pièces
if hasPlayerNoPieces(board: board, player: opponent) {
return (true, .winner(lastMove.owner, .noMorePieces))

Loading…
Cancel
Save