コード例 #1
0
        public ChallongeClient(string key)
        {
            apiKey = key ?? throw new ArgumentNullException("key");

            Tournaments  = new TournamentHandler(apiKey, httpClient);
            Participants = new ParticipantsHandler(apiKey, httpClient);
            Matches      = new MatchesHandler(apiKey, httpClient);
            Attachments  = new AttachmentsHandler(apiKey, httpClient);
        }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: cimiox/FitYourBody
    public void Awake()
    {
        GameObject tournament = GameObject.Find("Tournament");

        EnemyGO      = Instantiate(Resources.Load <GameObject>(EnemyPath), tournament.transform);
        EnemyGO.name = string.Format("Enemt[{0}]", tournament.transform.childCount);

        MuscleLevels = TournamentHandler.GetEnemyMusclesLevels(this);

        SetMuscles();
    }
コード例 #3
0
        public async Task newComp()
        {
            await Context.Channel.SendMessageAsync("Creating tournament for channel " + Context.Channel.Id);

            try
            {
                TournamentHandler.New(Context.Channel.Id.ToString());
            }
            catch (Exception)
            {
                await Context.Channel.SendMessageAsync("Tournament already going on!");
            }
        }
コード例 #4
0
        public ChallongeClient(string key, HttpClient httpClient)
        {
            string apiKey = key ?? throw new ArgumentNullException(nameof(key));

            if (httpClient == null)
            {
                throw new ArgumentNullException(nameof(httpClient));
            }

            Tournaments  = new TournamentHandler(apiKey, httpClient);
            Participants = new ParticipantsHandler(apiKey, httpClient);
            Matches      = new MatchesHandler(apiKey, httpClient);
            Attachments  = new AttachmentsHandler(apiKey, httpClient);
        }
コード例 #5
0
        public async Task join(string input)
        {
            int id;

            string[] inputArr = input.Split(',');
            if (inputArr.Length != 2)
            {
                await Context.Channel.SendMessageAsync("Please input both username and platform (\"!join YOURUSERNAME,YOURPLATFORM\"");
            }
            else
            {
                id = TournamentHandler.Join(inputArr, Context.Channel.Id.ToString());

                switch (id)
                {
                case -1: {
                    await Context.Channel.SendMessageAsync("Tournament does not exist!");

                    return;
                };

                case -2: {
                    await Context.Channel.SendMessageAsync("You have already joined!");

                    return;
                }

                case -3: {
                    await Context.Channel.SendMessageAsync("Account does not exist!");

                    return;
                }
                }

                await Context.Channel.SendMessageAsync("You been added! Your id: " + id);
            }
        }