|
|
|
|
@ -489,9 +489,20 @@ defer { |
|
|
|
|
}) { |
|
|
|
|
return seedGroupAvailable(atRoundIndex: roundIndex, availableSeedGroup: chunk) |
|
|
|
|
} else if fullLeftSeeds.count > 1, targetSpots > 1, fullLeftSeeds.count >= targetSpots { |
|
|
|
|
let seeds = seeds() |
|
|
|
|
if let firstIndex = seeds.firstIndex(where: { $0.isSeedable() }) { |
|
|
|
|
return seedGroupAvailable(atRoundIndex: roundIndex, availableSeedGroup: SeedInterval(first: firstIndex + 1, last: firstIndex + targetSpots)) |
|
|
|
|
let currentSeeds = seeds() |
|
|
|
|
if let firstIndex = currentSeeds.firstIndex(where: { $0.isSeedable() }) { |
|
|
|
|
|
|
|
|
|
if firstIndex < seededTeamsCount { |
|
|
|
|
return nil |
|
|
|
|
} else { |
|
|
|
|
let sg = SeedInterval(first: seededTeamsCount + 1, last: seededTeamsCount + targetSpots) |
|
|
|
|
let futureAvailableSeeds = self.seeds(inSeedGroup: sg) |
|
|
|
|
if futureAvailableSeeds.count >= targetSpots { |
|
|
|
|
return seedGroupAvailable(atRoundIndex: roundIndex, availableSeedGroup: sg) |
|
|
|
|
} else { |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|