upstreamSlotWinPredicate function
各列下标相同、有效且存在于各自 order 时返回该下标。
Implementation
int? upstreamSlotWinPredicate(List<int> indices, SlotConfig config) {
if (indices.isEmpty || indices.length != config.reels.length) return null;
final first = indices.first;
if (first < 0 || first >= config.prizes.length) return null;
for (var r = 0; r < indices.length; r++) {
if (indices[r] != first ||
!(config.reels[r].order?.contains(first) ?? true)) {
return null;
}
}
return first;
}