public ManiaPPCalculator()
 {
     mania_pp_calc = new ManiaPerformanceCalculator();
 }
Exemple #2
0
        /// <inheritdoc/>
        public PPTuple GetPPTuple(OrtdpWrapper.OrtdpWrapper ortdpInfo)
        {
            try
            {
                if (ortdpInfo.CurrentMode == OsuGameMode.Mania && ortdpInfo.Beatmap.Mode != OsuGameMode.Mania)
                {
                    return new PPTuple
                           {
                               FullComboAccuracyPP = 0,
                               FullComboAimPP      = 0,
                               FullComboPP         = 0,
                               FullComboSpeedPP    = 0,
                               MaxAccuracyPP       = 0,
                               MaxAimPP            = 0,
                               MaxPP              = 0,
                               MaxSpeedPP         = 0,
                               RealTimeAccuracyPP = 0,
                               RealTimeAimPP      = 0,
                               RealTimePP         = 0,
                               RealTimeSpeedPP    = 0
                           }
                }
                ;
                _calculator = _calculator ?? new ManiaPerformanceCalculator();
                _calculator.ClearCache();
                _calculator.Beatmap = new BeatmapReader(ortdpInfo.OrtdpBeatmap, (int)ortdpInfo.Beatmap.Mode);
                if (ortdpInfo.DebugMode)
                {
                    OutputHelper.Output(
                        $"[osuTools::PrePPCalc::Mania] Current ORTDP Beatmap:{_calculator.Beatmap.OrtdpBeatmap.Artist} - {_calculator.Beatmap.OrtdpBeatmap.Title} [{_calculator.Beatmap.OrtdpBeatmap.Difficulty}]",
                        true, false);
                }
                _calculator.Count50   = 0;
                _calculator.CountGeki = ortdpInfo.Beatmap.HitObjects.Count;
                _calculator.CountKatu = 0;
                _calculator.Count100  = 0;
                _calculator.CountMiss = 0;
                _calculator.Mods      = (uint)ortdpInfo.Mods.ToIntMod();
                _calculator.MaxCombo  = ortdpInfo.Beatmap.HitObjects.Count;
                _calculator.Count300  = 0;
                if (ortdpInfo.DebugMode)
                {
                    OutputHelper.Output("[osuTools::PrePPCalc::Mania] Calc Completed", true, false);
                }
                return(_calculator.GetPerformance());
            }

            catch (Exception ex)
            {
                OutputHelper.Output("Error when PreCalc PP.");
                if (ortdpInfo.DebugMode)
                {
                    OutputHelper.Output($"[osuTools::PrePPCalc::Taiko] Exception:{ex.Message}");
                }
                return(new PPTuple
                {
                    FullComboAccuracyPP = -1,
                    FullComboAimPP = -1,
                    FullComboPP = -1,
                    FullComboSpeedPP = -1,
                    MaxAccuracyPP = -1,
                    MaxAimPP = -1,
                    MaxPP = -1,
                    MaxSpeedPP = -1,
                    RealTimeAccuracyPP = -1,
                    RealTimeAimPP = -1,
                    RealTimePP = -1,
                    RealTimeSpeedPP = -1
                });
            }
        }