♻️ Make victory tiles non optional (in case of victory)
continuous-integration/drone/push Build is passing Details

main
Alexis Drai 2 years ago
parent b0c264efec
commit 949cbd7fca

@ -41,13 +41,13 @@ public enum Result : Equatable {
switch rhs { switch rhs {
case .won(let rPlayerId, let rVictoryTiles) : case .won(let rPlayerId, let rVictoryTiles) :
if (lPlayerId != rPlayerId || lVictoryTiles == nil || rVictoryTiles == nil) { if (lPlayerId != rPlayerId) {
return false return false
} }
for n in 0..<lVictoryTiles!.count { for n in 0..<lVictoryTiles.count {
if (lVictoryTiles![n].0 != rVictoryTiles![n].0 if (lVictoryTiles[n].0 != rVictoryTiles[n].0
|| lVictoryTiles![n].1 != rVictoryTiles![n].1) { || lVictoryTiles[n].1 != rVictoryTiles[n].1) {
return false return false
} }
} }
@ -64,6 +64,6 @@ public enum Result : Equatable {
case deadlocked case deadlocked
// playerId, victoryTiles // playerId, victoryTiles
case won(Int, [(Int, Int)]?) case won(Int, [(Int, Int)])
} }

Loading…
Cancel
Save