public void AddBrackets(IEnumerable <Bracket> brackets) { foreach (var item in brackets) { Brackets.Add(item); } }
/// <summary> /// Adds a Bracket object to the list of Brackets. /// If the list already contains this Bracket, an exception is thrown. /// </summary> /// <param name="_bracket">Bracket to add</param> public void AddBracket(IBracket _bracket) { if (null == _bracket) { throw new ArgumentNullException("_bracket"); } if (null == Brackets) { throw new NullReferenceException ("Bracket list is null; this shouldn't happen..."); } if (Brackets.Contains(_bracket)) { throw new DuplicateObjectException ("Tournament already contains this Bracket!"); } Brackets.Add(_bracket); }
/// <summary> /// Creates a new Round Robin "Group Stage," and adds it to the bracketlist. /// This is just a wrapper method that calls the bracket ctor /// and adds the resulting Bracket object to the list. /// </summary> /// <param name="_playerList">List of Players</param> /// <param name="_numGroups">How many groups to divide Players into</param> /// <param name="_maxGamesPerMatch">Max games, applied to every Match</param> /// <param name="_maxRounds">Limit of rounds to generate (0 = full round robin)</param> public void AddRRGroupStage(List <IPlayer> _playerList, int _numGroups = 2, int _maxGamesPerMatch = 1, int _maxRounds = 0) { Brackets.Add(new RoundRobinGroups(_playerList, _numGroups, _maxGamesPerMatch, _maxRounds)); }
/// <summary> /// Creates a new Swiss-style Bracket, and adds it to the bracketlist. /// This is just a wrapper method that calls the bracket ctor /// and adds the resulting Bracket object to the list. /// </summary> /// <param name="_playerList">List of Players</param> /// <param name="_pairingMethod">Method for matchup pairing: Slide, Fold, or Adjacent</param> /// <param name="_maxGamesPerMatch">Max games, applied to every Match</param> /// <param name="_numRounds">Limit of rounds to generate (0 = full Swiss)</param> public void AddSwissBracket(List <IPlayer> _playerList, PairingMethod _pairingMethod = PairingMethod.Slide, int _maxGamesPerMatch = 1, int _numRounds = 0) { Brackets.Add(new SwissBracket(_playerList, _pairingMethod, _maxGamesPerMatch, _numRounds)); }
/// <summary> /// Creates a new Round Robin Bracket, and adds it to the bracketlist. /// This is just a wrapper method that calls the bracket ctor /// and adds the resulting Bracket object to the list. /// </summary> /// <param name="_playerList">List of Players</param> /// <param name="_maxGamesPerMatch">Max games, applied to every Match</param> /// <param name="_numRounds">Limit of rounds to generate (0 = full round robin)</param> public void AddRoundRobinBracket(List <IPlayer> _playerList, int _maxGamesPerMatch = 1, int _numRounds = 0) { Brackets.Add(new RoundRobinBracket(_playerList, _maxGamesPerMatch, _numRounds)); }
/// <summary> /// Creates a new Stepladder Bracket, and adds it to the bracketlist. /// This is just a wrapper method that calls the bracket ctor /// and adds the resulting Bracket object to the list. /// </summary> /// <param name="_playerList">List of Players</param> /// <param name="_maxGamesPerMatch">Max games, applied to every Match</param> public void AddStepladderBracket(List <IPlayer> _playerList, int _maxGamesPerMatch = 1) { Brackets.Add(new StepladderBracket(_playerList, _maxGamesPerMatch)); }
/// <summary> /// Creates a new Double-Elim Bracket, and adds it to the bracketlist. /// This is just a wrapper method that calls the bracket ctor /// and adds the resulting Bracket object to the list. /// </summary> /// <param name="_playerList">List of Players</param> /// <param name="_maxGamesPerMatch">Max games, applied to every Match</param> public void AddDoubleElimBracket(List <IPlayer> _playerList, int _maxGamesPerMatch = 1) { Brackets.Add(new DoubleElimBracket(_playerList, _maxGamesPerMatch)); }