예제 #1
0
// ReSharper disable InconsistentNaming
        internal static bool Prefix(FlyingScoreEffect __instance, NoteCutInfo ____noteCutInfo)
// ReSharper enable InconsistentNaming
        {
            if (ConfigProvider.CurrentConfig == null)
            {
                return(true);
            }

            if (ConfigProvider.CurrentConfig.DoIntermediateUpdates)
            {
                ScoreModel.RawScoreWithoutMultiplier(____noteCutInfo, out var before, out var after, out var accuracy);
                var total = before + after + accuracy;
                JudgmentService.Judge(__instance, total, before, after, accuracy);
            }

            return(false);
        }
// ReSharper disable InconsistentNaming
        internal static void Postfix(FlyingScoreEffect __instance, NoteCutInfo noteCutInfo)
// ReSharper restore InconsistentNaming
        {
            if (ConfigProvider.CurrentConfig == null)
            {
                return;
            }

            void Judge(SaberSwingRatingCounter counter)
            {
                ScoreModel.RawScoreWithoutMultiplier(noteCutInfo, out var before, out var after, out var accuracy);
                var total = before + after + accuracy;

                JudgmentService.Judge(__instance, total, before, after, accuracy);

                // If the counter is finished, remove our event from it
                counter.didFinishEvent -= Judge;
            }

            // Apply judgments a total of twice - once when the effect is created, once when it finishes.
            Judge(noteCutInfo.swingRatingCounter);
            noteCutInfo.swingRatingCounter.didFinishEvent += Judge;
        }
예제 #3
0
 internal void Construct(JudgmentService judgmentService, ConfigProvider configProvider)
 {
     _judgmentService = judgmentService;
     _configuration   = configProvider.GetCurrentConfig();
 }