public int GetExpectedParticipantCount() { int participants; if (IsFirstRound()) { participants = Tournament.PlayerReferences.Count; } else { RoundBase round = GetPreviousRound(); participants = round.Groups.Count * round.AdvancingPerGroupCount; } return(Math.Max(2, participants)); }
public bool Construct() { ConstructGroups(); AssignDefaultStartTimeToMatchesInRound(); RoundBase nextRound = GetNextRound(); bool nextRoundExist = nextRound != null; if (nextRoundExist) { return(nextRound.Construct()); } MarkAsModified(); return(true); }
private List <PlayerReference> GetNextGroupOfPlayers(int startIndex, int count) { if (IsFirstRound()) { count = Math.Min(startIndex + count, Tournament.PlayerReferences.Count) - startIndex; return(Tournament.PlayerReferences.GetRange(startIndex, count)); } else { RoundBase previousRound = GetPreviousRound(); if (previousRound.GetPlayState() == PlayStateEnum.Finished) { List <PlayerReference> playerReferences = previousRound.GetAdvancingPlayerReferences(); count = Math.Min(startIndex + count, playerReferences.Count) - startIndex; return(playerReferences.GetRange(startIndex, count)); } } return(new List <PlayerReference>()); }