private void viewButton_Click(object sender, RoutedEventArgs e) { if (logTable.SelectedItems.Count != 0) { RaidHeader row = (RaidHeader)logTable.SelectedItems[0]; NavigationService ns = this.NavigationService; ns.Navigate(new StatsPage(row)); } }
public RaidHeader[] getRaidHeaders(bool forceRefresh = false) { RaidHeader[] events; if (forceRefresh) { RowSet set = Cassandra.Instance.GetRaidHeaders(); events = RaidHeader.convert(set); root.Put("RaidHeaders", events); return(events); } events = (RaidHeader[])root.Get("RaidHeaders"); if (events == null || events.Length == 0) { return(getRaidHeaders(true)); } return(events); }
public StatsPage(RaidHeader row) { this.row = row; this.currentRaid = row.Raid; this.currentEncounter = row.Encounter; DamageEvent[] damageEvents = Perst.Instance.getDamageForRaidEncounter(row.Raid, row.Encounter); HealingEvent[] healingEvents = Perst.Instance.getHealingForRaidEncounter(row.Raid, row.Encounter); UnitTotalDamage[] damageRaidArray = Perst.Instance.getInvolvedUnitsDamage(row.Raid, row.Encounter); UnitTotalHealing[] healingRaidArray = Perst.Instance.getInvolvedUnitsHealing(row.Raid, row.Encounter); long totalDamge = 0; foreach (UnitTotalDamage damage in damageRaidArray) { raidDamage.Add(new RaidEffectRow(damage, row.EncounterTime)); totalDamge += damage.Damage; } long totalHealing = 0; foreach (UnitTotalHealing healing in healingRaidArray) { raidHealing.Add(new RaidEffectRow(healing, row.EncounterTime)); totalHealing += healing.Healing; } InitializeComponent(); statsDescription.DataContext = new statText(String.Format("Average HPS: {0}hps\nAverage DPS: {1}dps\nPlayeres: {2}\nTotal healing: {3}\nTotal Damage: {4}\nFight Length: {5}s", totalHealing / row.EncounterTime, totalDamge / row.EncounterTime, damageRaidArray.Length, totalHealing, totalDamge, row.EncounterTime)); button_Checked(null, null); // Set a default player. if (raidDamage.Count > 0) { updatePlayerTable(raidDamage[0].Source); } }