Ejemplo n.º 1
0
        public RoundResponse Create(Round round, RoundState roundState)
        {
            if(round == null)
                throw new ArgumentNullException("round");

            return new RoundResponse(
                number: round.Number,
                started: roundState >= RoundState.Committed,
                completed: roundState >= RoundState.Completed,
                final: roundState >= RoundState.Final,
                matches: round
                    .Matches
                    .OrderBy(match => match.Number)
                    .Select(match => MatchResponseProvider.Create(match))
            );
        }
Ejemplo n.º 2
0
        public RoundResponse Create(Tournament tournament, Round round)
        {
            if(round == null)
                throw new ArgumentNullException("round");

            var roundState = RoundManager.GetRoundState(tournament, round.Number);

            return new RoundResponse(
                number: round.Number,
                started: roundState >= RoundState.Committed,
                completed: roundState >= RoundState.Completed,
                final: roundState >= RoundState.Final,
                matches: round
                    .Matches
                    .OrderBy(match => match.Number)
                    .Select(match => MatchResponseProvider.Create(match))
                    .ToArray()
            );
        }