コード例 #1
0
ファイル: Program.cs プロジェクト: timojch/xivmontecarlo
        private static void RunGraph()
        {
            foreach (var statNum in Enum.GetValues(typeof(Stat)))
            {
                var stat = (Stat)statNum;
                Console.WriteLine($"{(int)(stat + 1)} - {stat.ToString()}");
            }

            int      choice  = int.Parse(Console.ReadKey(true).KeyChar.ToString()) - 1;
            FileInfo outFile = new FileInfo("out.csv");

            using (Stream outStream = outFile.OpenWrite())
            {
                StreamWriter writer     = new StreamWriter(outStream);
                double       baseResult = 0;
                for (int stat = StatsGroup.Baseline[(Stat)choice]; stat < 5000; stat += 10)
                {
                    StatsGroup stats = CurrentStats.Copy();
                    stats[(Stat)choice] = stat;
                    double result = RunSimulation(stats, CurrentRotation.Value);

                    if (baseResult == 0)
                    {
                        baseResult = result;
                    }

                    Console.WriteLine($"{stat}\t{result / baseResult}");
                    writer.WriteLine($"{stat}\t{result / baseResult}");
                }
                writer.Flush();
            }
        }
コード例 #2
0
        public static double GetStatValue(this StatsGroup self, Stat stat)
        {
            StatsGroup higher = self.Copy();

            higher[stat] += 1;
            return(Formulas.CalculateDamageFromGCD(higher) - Formulas.CalculateDamageFromGCD(self));
        }
コード例 #3
0
        public static double GetContribution(this StatsGroup self, Stat stat)
        {
            StatsGroup lower = self.Copy();

            lower[stat] = StatsGroup.Baseline[stat];

            return(Formulas.CalculateDamageFromGCD(self) - Formulas.CalculateDamageFromGCD(lower));
        }