Esempio n. 1
0
        public async Task <List <ParticipantResult> > call(ChallongeAPICaller caller)
        {
            List <ParticipantsQueryResult> participantResults =
                await caller.GET <List <ParticipantsQueryResult> >(getAPIPath(), getParameters());

            return(participantResults.Select(x => x.participant).ToList());
        }
Esempio n. 2
0
        public async Task <MatchResult> call(ChallongeAPICaller caller)
        {
            MatchQueryResult result = await caller.GET <MatchQueryResult>(APIPath, Parameters);

            result.match.tournament_subdomain_id = TournamentID; //hack to add subdomain to matches
            return(result.match);
        }
        public async Task <ParticipantResult> call(ChallongeAPICaller caller)
        {
            int?id = ParticipantIDCache.Instance.GetParticipantID(ParticipantID);

            if (id.HasValue)
            {
                ParticipantQueryResult participantResult = await caller.GET <ParticipantQueryResult>(getAPIPath(id), getParameters());

                if (participantResult?.participant != null)
                {
                    return(participantResult.participant);
                }
            }

            List <ParticipantQueryResult> participantGroupResult = await caller.GET <List <ParticipantQueryResult> >(getAPIPath(null), getParameters());

            ParticipantIDCache.Instance.PopulateCache(participantGroupResult.Select(x => x.participant).ToArray());
            return(participantGroupResult.FirstOrDefault(x => x.participant.id == ParticipantID.ID || x.participant.group_player_ids.Contains(ParticipantID.GroupID))?.participant);
        }
        public async Task <List <MatchResult> > call(ChallongeAPICaller caller)
        {
            List <MatchesQueryResult> matchesQueryResult = await caller.GET <List <MatchesQueryResult> >(getAPIPath(), getParameters());

            List <MatchResult> matches = new List <MatchResult>();

            foreach (MatchesQueryResult queryResult in matchesQueryResult)
            {
                matches.Add(queryResult.match);
            }
            return(matches);
        }
        public async Task <List <TournamentResult> > call(ChallongeAPICaller caller)
        {
            List <TournamentsQueryResult> tournamentsQueryResult = await caller.GET <List <TournamentsQueryResult> >(getAPIPath(), getParameters());

            List <TournamentResult> tournaments = new List <TournamentResult>();

            foreach (TournamentsQueryResult queryResult in tournamentsQueryResult)
            {
                tournaments.Add(queryResult.tournament);
            }
            return(tournaments);
        }
        public async Task <List <MatchResult> > call(ChallongeAPICaller caller)
        {
            List <MatchesQueryResult> matchesQueryResult = await caller.GET <List <MatchesQueryResult> >(getAPIPath(), getParameters());

            List <MatchResult> matches = new List <MatchResult>();

            foreach (MatchesQueryResult queryResult in matchesQueryResult)
            {
                queryResult.match.tournament_subdomain_id = tournamentID; //hack to add subdomain to matches
                matches.Add(queryResult.match);
            }
            return(matches);
        }
Esempio n. 7
0
        public async Task <TournamentResult> call(ChallongeAPICaller caller)
        {
            TournamentQueryResult tournamentQueryResult = await caller.GET <TournamentQueryResult>(getAPIPath(), getParameters());

            return(tournamentQueryResult.tournament);
        }
Esempio n. 8
0
        public async Task <ParticipantResult> call(ChallongeAPICaller caller)
        {
            ParticipantQueryResult participantResult = await caller.GET <ParticipantQueryResult>(getAPIPath(), getParameters());

            return(participantResult.participant);
        }