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); }
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(); }
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!"); } }
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); }
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); } }