private ComparisonCalculationHunter comparisonFromStat(Character character, CharacterCalculationsHunter calcBase, Stats stats, string label) { ComparisonCalculationHunter comp = new ComparisonCalculationHunter(); CharacterCalculationsHunter calcStat = GetCharacterCalculations(character, new Item() { Stats = stats }) as CharacterCalculationsHunter; comp.Name = label; comp.HunterDpsPoints = calcStat.HunterDpsPoints - calcBase.HunterDpsPoints; comp.PetDpsPoints = calcStat.PetDpsPoints - calcBase.PetDpsPoints; comp.OverallPoints = calcStat.OverallPoints - calcBase.OverallPoints; return comp; }
private ComparisonCalculationHunter comparisonFromShotDPF(ShotData shot) { ComparisonCalculationHunter comp = new ComparisonCalculationHunter(); float dpm = shot.FocusCost > 0 ? (float)(shot.Damage / shot.FocusCost) : 0; comp.Name = Enum.GetName(typeof(Shots), shot.Type); comp.SubPoints = new float[] { dpm }; comp.OverallPoints = dpm; return comp; }
private ComparisonCalculationHunter comparisonFromShotSpammedMPS(ShotData shot) { ComparisonCalculationHunter comp = new ComparisonCalculationHunter(); float shotWait = shot.Duration > shot.Cd ? shot.Duration : shot.Cd; float mps = shotWait > 0 ? (float)(shot.FocusCost / shotWait) : 0; comp.Name = Enum.GetName(typeof(Shots), shot.Type); comp.SubPoints = new float[] { mps }; comp.OverallPoints = mps; return comp; }
private ComparisonCalculationHunter comparisonFromShotRotationFocusPS(ShotData shot) { ComparisonCalculationHunter comp = new ComparisonCalculationHunter(); comp.Name = Enum.GetName(typeof(Shots), shot.Type); comp.SubPoints = new float[] { (float)shot.FocusPS }; comp.OverallPoints = (float)shot.FocusPS; return comp; }
/*private ComparisonCalculationHunter[] GetPetTalentSpecsChart(Character character, CharacterCalculationsHunter calcs) { List<ComparisonCalculationBase> talentCalculations = new List<ComparisonCalculationBase>(); Character newChar = character.Clone(); /*PetTalentsBase nothing = character.CurrentTalents.Clone(); for (int i = 0; i < nothing.Data.Length; i++) nothing.Data[i] = 0; for (int i = 0; i < nothing.GlyphData.Length; i++) nothing.GlyphData[i] = false; newChar.CurrentTalents = nothing; CharacterCalculationsBase baseCalc = Calculations.GetCharacterCalculations(newChar, null, false, true, true); CharacterCalculationsBase newCalc; ComparisonCalculationBase compare; bool same, found = false; foreach (SavedTalentSpec sts in SavedTalentSpec.SpecsFor(character.Class)) { same = false; if (sts.Equals(character.CurrentTalents)) same = true; newChar.CurrentTalents = sts.TalentSpec(); newCalc = Calculations.GetCharacterCalculations(newChar, null, false, true, true); compare = Calculations.GetCharacterComparisonCalculations(baseCalc, newCalc, sts.Name, same); compare.Item = null; compare.Name = sts.ToString(); compare.Description = sts.Spec; talentCalculations.Add(compare); found = found || same; } if (!found) { newCalc = Calculations.GetCharacterCalculations(character, null, false, true, true); compare = Calculations.GetCharacterComparisonCalculations(baseCalc, newCalc, "Custom", true); talentCalculations.Add(compare); } //CGL_Legend.LegendItems = Calculations.SubPointNameColors; //ComparisonGraph.LegendItems = Calculations.SubPointNameColors; //ComparisonGraph.Mode = ComparisonGraph.DisplayMode.Subpoints; //ComparisonGraph.DisplayCalcs(talentCalculations.ToArray()); return talentCalculations.ToArray(); /*List<ComparisonCalculationHunter> talentCalculations = new List<ComparisonCalculationHunter>(); Character baseChar = character.Clone(); CalculationOptionsHunter baseCalcOpts = baseChar.CalculationOptions as CalculationOptionsHunter; Character newChar = character.Clone(); CalculationOptionsHunter newCalcOpts = newChar.CalculationOptions as CalculationOptionsHunter; CharacterCalculationsHunter currentCalc; CharacterCalculationsHunter newCalc; ComparisonCalculationHunter compare; currentCalc = (CharacterCalculationsHunter)Calculations.GetCharacterCalculations(baseChar, null, false, true, false); foreach (PropertyInfo pi in baseCalcOpts.PetTalents.GetType().GetProperties()) { PetTalentDataAttribute[] petTalentDatas = pi.GetCustomAttributes(typeof(PetTalentDataAttribute), true) as PetTalentDataAttribute[]; int orig; if (petTalentDatas.Length > 0) { PetTalentDataAttribute petTalentData = petTalentDatas[0]; orig = baseCalcOpts.PetTalents.Data[petTalentData.Index]; if (petTalentData.MaxPoints == (int)pi.GetValue(baseCalcOpts.PetTalents, null)) { newCalcOpts.PetTalents.Data[petTalentData.Index]--; newCalc = (CharacterCalculationsHunter)GetCharacterCalculations(newChar, null, false, true, false); compare = (ComparisonCalculationHunter)GetCharacterComparisonCalculations(newCalc, currentCalc, petTalentData.Name, petTalentData.MaxPoints == orig); } else { newCalcOpts.PetTalents.Data[petTalentData.Index]++; newCalc = (CharacterCalculationsHunter)GetCharacterCalculations(newChar, null, false, true, false); compare = (ComparisonCalculationHunter)GetCharacterComparisonCalculations(currentCalc, newCalc, petTalentData.Name, petTalentData.MaxPoints == orig); } string text = string.Format("Current Rank {0}/{1}\r\n\r\n", orig, petTalentData.MaxPoints); if (orig == 0) { // We originally didn't have it, so first rank is next rank text += "Next Rank:\r\n"; text += petTalentData.Description[0]; } else if (orig >= petTalentData.MaxPoints) { // We originally were at max, so there isn't a next rank, just show the capped one text += petTalentData.Description[petTalentData.MaxPoints - 1]; } else { // We aren't at 0 or MaxPoints originally, so it's just a point in between text += petTalentData.Description[orig - 1]; text += "\r\n\r\nNext Rank:\r\n"; text += petTalentData.Description[orig]; } compare.Description = text; compare.Item = null; talentCalculations.Add(compare); newCalcOpts.PetTalents.Data[petTalentData.Index] = orig; } } return talentCalculations.ToArray(); }*/ #if FALSE private ComparisonCalculationHunter comparisonFromShotSpammedDPS(ShotData shot) { ComparisonCalculationHunter comp = new ComparisonCalculationHunter(); float shotWait = shot.Duration > shot.Cd ? shot.Duration : shot.Cd; float dps = shotWait > 0 ? (float)(shot.Damage / shotWait) : 0; comp.Name = Enum.GetName(typeof(Shots), shot.Type); comp.HunterDPSPoints = dps; comp.OverallPoints = dps; return comp; }