Exemplo n.º 1
0
        /// <param name="bm">The beatmap, diffcalc will run on this.</param>
        /// <param name="accuracy">Accuracy</param>
        /// <param name="cMiss">Amount of misses</param>
        /// <param name="combo">The combo reached by the player. At least this or <paramref name="c300"/> has to be set.</param>
        /// <param name="mods">The used mods.</param>
        public PPv2Parameters(Beatmap bm, double accuracy, int cMiss = 0, int combo = -1, Mods mods = Mods.NoMod)
        {
            if (bm == null)
            {
                throw new ArgumentNullException(nameof(bm));
            }

            var d = new DiffCalc().Calc(bm, mods);

            Mode          = bm.Mode;
            BaseAR        = bm.AR;
            BaseOD        = bm.OD;
            MaxCombo      = bm.GetMaxCombo();
            CountSliders  = bm.CountSliders;
            CountCircles  = bm.CountCircles;
            CountSpinners = bm.CountSpinners;
            CountObjects  = bm.Objects.Count;

            AimStars   = d.Aim;
            SpeedStars = d.Speed;
            CountMiss  = cMiss;
            Combo      = combo;
            Mods       = mods;

            Accuracy = accuracy;
        }
Exemplo n.º 2
0
        /// <param name="bm">The Beatmap object</param>
        /// <param name="d">The DiffCalc object that ran on this beatmap</param>
        /// <param name="accuracy">Accuracy in 0..1 range</param>
        /// <param name="cMiss">Amount of misses</param>
        /// <param name="combo">The combo reached by the player. At least this or <paramref name="c300"/> has to be set.</param>
        /// <param name="mods">The used mods.</param>
        public PPv2Parameters(Beatmap bm, DiffCalc d, double accuracy, int cMiss = 0, int combo = -1,
                              Mods mods = Mods.NoMod)
        {
            if (bm == null)
            {
                throw new ArgumentNullException(nameof(bm));
            }

            //run DiffCalc if it hadn't yet
            if (d.CountSingles == 0 && Math.Abs(d.Total) <= double.Epsilon)
            {
                d.Calc(bm, mods);
            }

            Mode          = bm.Mode;
            BaseAR        = bm.AR;
            BaseOD        = bm.OD;
            MaxCombo      = bm.GetMaxCombo();
            CountSliders  = bm.CountSliders;
            CountCircles  = bm.CountCircles;
            CountSpinners = bm.CountSpinners;
            CountObjects  = bm.Objects.Count;

            AimStars   = d.Aim;
            SpeedStars = d.Speed;
            CountMiss  = cMiss;
            Combo      = combo;
            Mods       = mods;

            Accuracy = accuracy;
        }
Exemplo n.º 3
0
        /// <param name="bm">The beatmap, diffcalc will run on this.</param>
        /// <param name="c300">Amount of 300's. At least this or <paramref name="combo"/> has to be set.</param>
        /// <param name="c100">Amount of 100's</param>
        /// <param name="c50">Amount of 50's</param>
        /// <param name="cMiss">Amount of misses</param>
        /// <param name="combo">The combo reached by the player. At least this or <paramref name="c300"/> has to be set.</param>
        /// <param name="mods">The used mods.</param>
        public PPv2Parameters(Beatmap bm, int c100, int c50 = 0, int cMiss = 0, int combo = -1, int c300 = -1, Mods mods = Mods.NoMod)
        {
            var d = new DiffCalc().Calc(bm, mods);

            Beatmap    = bm;
            AimStars   = d.Aim;
            SpeedStars = d.Speed;
            Count100   = c100;
            Count50    = c50;
            CountMiss  = cMiss;
            Combo      = combo;
            Count300   = c300;
            Mods       = mods;
        }
Exemplo n.º 4
0
        /// <param name="bm">The Beatmap object</param>
        /// <param name="d">The DiffCalc object that ran on this beatmap</param>
        /// <param name="c300">Amount of 300's. At least this or <paramref name="combo"/> has to be set.</param>
        /// <param name="c100">Amount of 100's</param>
        /// <param name="c50">Amount of 50's</param>
        /// <param name="cMiss">Amount of misses</param>
        /// <param name="combo">The combo reached by the player. At least this or <paramref name="c300"/> has to be set.</param>
        /// <param name="mods">The used mods.</param>
        public PPv2Parameters(Beatmap bm, DiffCalc d, int c100, int c50 = 0, int cMiss = 0, int combo = -1, int c300 = -1, Mods mods = Mods.NoMod)
        {
            //run DiffCalc if it hadn't yet
            if (d.CountSingles == 0 && Math.Abs(d.Total) <= double.Epsilon)
            {
                d.Calc(bm, mods);
            }

            Beatmap    = bm;
            AimStars   = d.Aim;
            SpeedStars = d.Speed;
            Count100   = c100;
            Count50    = c50;
            CountMiss  = cMiss;
            Combo      = combo;
            Count300   = c300;
            Mods       = mods;
        }