|
|
|
@ -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))
|
|
|
|
|