Fixed scope issue on collected playerMoves
This commit is contained in:
parent
eaa71d1d73
commit
42f4537dc6
@ -35,7 +35,7 @@ class RoundCalculatorService {
|
|||||||
var baseSpecificMoves = collectBaseSpecificMoves()
|
var baseSpecificMoves = collectBaseSpecificMoves()
|
||||||
|
|
||||||
// TODO: Refactor to a less complex way
|
// TODO: Refactor to a less complex way
|
||||||
for (baseId, var playerMovesByBase) in baseSpecificMoves {
|
for (baseId, playerMovesByBase) in baseSpecificMoves {
|
||||||
let targetBase = currentSnapshotModel?.baseEntites.filter { $0.baseId == baseId }[0]
|
let targetBase = currentSnapshotModel?.baseEntites.filter { $0.baseId == baseId }[0]
|
||||||
let possiblyOwnershipMoves = playerMovesByBase.filter { $0.key == targetBase?.ownership}
|
let possiblyOwnershipMoves = playerMovesByBase.filter { $0.key == targetBase?.ownership}
|
||||||
|
|
||||||
@ -50,10 +50,10 @@ class RoundCalculatorService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
playerMovesByBase.removeValue(forKey: playerName)
|
baseSpecificMoves[baseId]!.removeValue(forKey: playerName)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (_, playerMoves) in playerMovesByBase {
|
for playerMoves in baseSpecificMoves[baseId]!.values {
|
||||||
for playerMove in playerMoves {
|
for playerMove in playerMoves {
|
||||||
for base in currentSnapshotModel!.baseEntites {
|
for base in currentSnapshotModel!.baseEntites {
|
||||||
if base.baseId == playerMove.fromBase {
|
if base.baseId == playerMove.fromBase {
|
||||||
|
Loading…
Reference in New Issue
Block a user