예제 #1
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);
        }
예제 #2
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());
        }
        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);
        }
예제 #5
0
        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);
        }
        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);
        }
예제 #7
0
        public MatchObject(MatchResult result, ChallongeAPICaller caller)
        {
            this.result = result;
            this.caller = caller;
            switch (result.state)
            {
            case "open":
                matchState = MatchState.Open;
                break;

            case "pending":
                matchState = MatchState.Pending;
                break;

            case "completed":
                matchState = MatchState.Complete;
                break;

            default:
                throw new InvalidMatchState();
            }
            updateMatchQuery = new UpdateMatchQuery(result);
        }
 public async Task <bool> call(ChallongeAPICaller caller)
 {
     return(await caller.POST(getAPIPath(), getParameters()));
 }
예제 #9
0
        public async Task <TournamentResult> call(ChallongeAPICaller caller)
        {
            TournamentQueryResult tournamentQueryResult = await caller.GET <TournamentQueryResult>(getAPIPath(), getParameters());

            return(tournamentQueryResult.tournament);
        }
예제 #10
0
        public async Task <ParticipantResult> call(ChallongeAPICaller caller)
        {
            ParticipantQueryResult participantResult = await caller.POST <ParticipantQueryResult>(getAPIPath(), getParameters());

            return(participantResult.participant);
        }
예제 #11
0
 public TournamentObject(TournamentResult result, ChallongeAPICaller caller)
 {
     this.result = result;
     this.caller = caller;
 }
 public TournamentCreator(ChallongeAPICaller caller)
 {
     this.caller = caller;
 }
예제 #13
0
 public ChallongeMatches(ChallongeAPICaller caller)
 {
     Caller = caller;
 }
 public async Task <bool> call(ChallongeAPICaller caller)
 {
     return(await caller.POST(API, new ChallongeQueryParameters()));
 }
 public ChallongeTournaments(ChallongeAPICaller caller, string subdomain = "")
 {
     this.caller = caller;
     this.TournamentSubdomain = subdomain;
 }
        public async Task <MatchResult> call(ChallongeAPICaller caller)
        {
            MatchQueryResult matchQueryResult = await caller.PUT <MatchQueryResult>(getAPIPath(), getParameters());

            return(matchQueryResult.match);
        }
예제 #17
0
 public Tournaments(ChallongeAPICaller caller)
 {
     this.caller = caller;
 }
 public static async Task <bool> CheckIn(string tournId, int partId, ChallongeAPICaller caller)
 {
     return(await new ParticipantCheckInQuery(tournId, partId).call(caller));
 }