private void formItems_Load(object sender, EventArgs e) { this.items = RiotAPI.GetItemInfo(); this.source = new SortableBindingList <ItemInfo>(this.items.Values.OrderBy(item => item.Name).ToList()); this.ConstructFilter(); return; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!RiotAPI.LoadKey()) { MessageBox.Show("Unable to load API key.", "API Key"); return; } Application.Run(new formMenu()); }
private void formChampions_Load(object sender, EventArgs e) { this.champions = RiotAPI.GetChampionInfo(); this.source = new SortableBindingList<ChampionInfo>(this.champions.Values.OrderBy(champ => champ.Name).ToList()); this.gridMain.DataSource = this.source; this.comboFilter.DataSource = this.gridMain.Columns.Cast<DataGridViewColumn>().Where(col => !(col is DataGridViewImageColumn)).Select(col => col.HeaderText) .OrderBy(text => text).ToList<string>(); this.fTooltip.Location = new Point(this.Right + 10, this.Top); this.ShowTooltip(this.gridMain.SelectedCells.Count > 0 && this.gridMain.SelectedCells[0].RowIndex > -1 ? this.gridMain.SelectedCells[0].RowIndex : 0, this.gridMain.SelectedCells.Count > 0 && this.gridMain.SelectedCells[0].ColumnIndex > -1 ? this.gridMain.SelectedCells[0].ColumnIndex : 0); return; }
public void CheckSummonerTest() { RiotAPI riotApiTest = new RiotAPI(); string name = "gesnons"; var summoner = riotApiTest.GetSummoner(name); Assert.AreEqual(name, summoner.Name); Assert.AreEqual(172, summoner.Level); }
public async System.Threading.Tasks.Task GetMatchHistoryForChampionAsync() { RiotAPI riotApiTest = new RiotAPI(); string name = "gesnons"; string championName = "Nautilus"; var summoner = riotApiTest.GetSummoner(name); var matchHistory = await riotApiTest.GetWinratioAgainstChampionAsync(summoner.AccountId, championName); Console.WriteLine(matchHistory.ToString()); }
public static void Initialize() { rtmpLog = BackEndServer.LogService.CreateLog("RTMP"); logFile = Path.Combine(AppData, "logs", "client", DateTime.Now.ToString("M-d H-mm") + ".txt"); Directory.CreateDirectory(Path.GetDirectoryName(logFile)); #if DEBUG rtmpLogFile = Path.Combine(AppData, "logs", "rtmp", DateTime.Now.ToString("M-d H-mm") + ".txt"); Directory.CreateDirectory(Path.GetDirectoryName(rtmpLogFile)); #endif RiotAPI = RiotAPI.Debug(MFroehlich.League.RiotAPI.Region.NA, "5d8ea4aa-db1c-43ea-aacd-888129dadf11"); Log("Patch: " + (clientVersion = MFroehlich.League.Assets.DataDragon.CurrentVersion)); //Static init// Init = Task.Run(async() => { Latest = await RiotVersion.GetLatestVersion(); Log($"Air: {Latest.AirVersion}"); Log($"Game: {Latest.GameVersion}"); Log($"Solution: {Latest.SolutionVersion}"); }); }
private void formMaps_Load(object sender, EventArgs e) { this.source = RiotAPI.GetMapInfo(); this.comboMaps.SelectedIndex = this.comboMaps.Items.IndexOf("Summoner's Rift"); return; }
private void ShowTooltip(int row_index, int column_index) { if (row_index < 0 || column_index < 0 || row_index >= this.gridMain.RowCount || column_index >= this.gridMain.ColumnCount || (this.fTooltip.Visible && this.itmLockTooltip.Checked)) return; string champion_name = this.gridMain.Rows[row_index].Cells["colName"].Value.ToString(); this.last_champ_name = RiotAPI.CleanseChampionName(this.champions, champion_name); ChampionInfo info = this.champions[this.last_champ_name]; string column_name = this.gridMain.Columns[column_index].HeaderText; string value_out = "???"; string subtitle_out = column_name; switch (column_name) { case "Attack": value_out = info.RatingInfo.Attack.ToString() + " / 10"; break; case "Defense": value_out = info.RatingInfo.Defense.ToString() + " / 10"; break; case "Difficulty": value_out = info.RatingInfo.Difficulty.ToString() + " / 10"; break; case "Magic": value_out = info.RatingInfo.Magic.ToString() + " / 10"; break; case "Passive": value_out = " " + info.PassiveDescription; subtitle_out = info.PassiveName + " (Passive)"; break; // case "Q": value_out = " " + info.SpellDescriptionQ; subtitle_out = info.SpellNameQ + " (Q)"; break; case "W": value_out = " " + info.SpellDescriptionW; subtitle_out = info.SpellNameW + " (W)"; break; case "E": value_out = " " + info.SpellDescriptionE; subtitle_out = info.SpellNameE + " (E)"; break; case "R": value_out = " " + info.SpellDescriptionR; subtitle_out = info.SpellNameR + " (R)"; break; // case "Image": value_out = info.SkinList; subtitle_out = "Skins"; break; case "Free": value_out = info.FreeToPlay.ToString(); subtitle_out = "Free to Play?"; break; case "Name": value_out = info.LoreSummary; subtitle_out = "Lore Summary"; break; case "Tags": value_out = info.TagList; break; case "Title": value_out = info.LoreSummary; subtitle_out = "Lore Summary"; break; } this.fTooltip.ShowTooltip(info.Name, subtitle_out, value_out, this); }
private void GotGameInfo(RiotAPI.CurrentGameAPI.CurrentGameInfo game) { CurrentGameInfo = game; Session.Current.ChatManager.ForceUpdate(); }