Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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()));
 }
Ejemplo n.º 9
0
        public async Task <TournamentResult> call(ChallongeAPICaller caller)
        {
            TournamentQueryResult tournamentQueryResult = await caller.GET <TournamentQueryResult>(getAPIPath(), getParameters());

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

            return(participantResult.participant);
        }
Ejemplo n.º 11
0
 public TournamentObject(TournamentResult result, ChallongeAPICaller caller)
 {
     this.result = result;
     this.caller = caller;
 }
 public TournamentCreator(ChallongeAPICaller caller)
 {
     this.caller = caller;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
 }