public List <SWData.Rune> SortedRuneList(List <SWData.Rune> RuneList) { List <SWData.Rune> sortset = new List <SWData.Rune>(); if (RuneList.Count > 0) { SWData.Rune tempRune = new SWData.Rune(); sortset.Add(RuneList.FirstOrDefault(x => x.slot == 1)); sortset.Add(RuneList.FirstOrDefault(x => x.slot == 2)); sortset.Add(RuneList.FirstOrDefault(x => x.slot == 3)); sortset.Add(RuneList.FirstOrDefault(x => x.slot == 4)); sortset.Add(RuneList.FirstOrDefault(x => x.slot == 5)); sortset.Add(RuneList.FirstOrDefault(x => x.slot == 6)); } return(sortset); }
private void cmbxMonList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!String.IsNullOrEmpty(e.Source.ToString()) && mainDC != null) { string selectedMon = e.AddedItems[0].ToString(); SWData.Mon mon = mainDC.GetMonster(selectedMon); lblHPBase.Content = mon.b_hp.ToString(); lblDefBase.Content = mon.b_def.ToString(); lblAtkBase.Content = mon.b_atk.ToString(); lblSpeedBase.Content = mon.b_spd.ToString(); //lblTest.Content = e.AddedItems[0].ToString(); List <SWData.Rune> runes = mainDC.GetMonsterRune(mon.name); lblTest.Content = runes.Count.ToString(); SWData.Rune rune1 = runes.Find(x => x.slot == 1); txtblkRune1.Text = String.Format("{0} {1} {2} {3}", rune1.id, rune1.grade, rune1.set, rune1.slot); } else { lblHPBase.Content = ""; lblDefBase.Content = ""; lblAtkBase.Content = ""; lblSpeedBase.Content = ""; } }