IEnumerable <float> waitForMinPlayers() { int myIndex; if (G.Sys.PlayerManager_.PlayerList_.Count < getMinPlayers() && autoMode) { AutoSpecCmd autoSpecCommand = list.getCommand <AutoSpecCmd>("autospec"); var specCount = autoSpecCommand.getAutoSpecPlayers().Count; if (specCount != 0) { string specWord = specCount == 1 ? "is" : "are"; MessageUtilities.sendMessage($"Waiting for there to be {minPlayers} players. ({specCount} {specWord} auto-spectating)"); } else { MessageUtilities.sendMessage($"Waiting for there to be {minPlayers} players."); } while (G.Sys.PlayerManager_.PlayerList_.Count < getMinPlayers() && autoMode) { myIndex = index; yield return(5.0f); if (index != myIndex) { yield break; } } } }
public int getMinPlayers() { AutoSpecCmd autoSpecCommand = list.getCommand <AutoSpecCmd>("autospec"); return(minPlayers + autoSpecCommand.getAutoSpecPlayers().Count); }