mirror of
https://github.com/ppy/osu-tools.git
synced 2025-06-09 09:35:15 +09:00
41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using osu.Framework.Allocation;
|
|
using osu.Game.Beatmaps;
|
|
using osu.Game.Rulesets;
|
|
using osu.Game.Rulesets.Catch.Difficulty.Preprocessing;
|
|
using osu.Game.Rulesets.Catch.Edit;
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
namespace PerformanceCalculatorGUI.Screens.ObjectInspection
|
|
{
|
|
public partial class CatchObjectInspectorRuleset : DrawableCatchEditorRuleset
|
|
{
|
|
private readonly CatchDifficultyHitObject[] difficultyHitObjects;
|
|
|
|
[Resolved]
|
|
private ObjectDifficultyValuesContainer objectDifficultyValuesContainer { get; set; }
|
|
|
|
public CatchObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods, ExtendedCatchDifficultyCalculator difficultyCalculator, double clockRate)
|
|
: base(ruleset, beatmap, mods)
|
|
{
|
|
difficultyHitObjects = difficultyCalculator.GetDifficultyHitObjects(beatmap, clockRate)
|
|
.Cast<CatchDifficultyHitObject>().ToArray();
|
|
}
|
|
|
|
public override bool PropagatePositionalInputSubTree => false;
|
|
|
|
public override bool PropagateNonPositionalInputSubTree => false;
|
|
|
|
public override bool AllowBackwardsSeeks => true;
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
objectDifficultyValuesContainer.CurrentDifficultyHitObject.Value = difficultyHitObjects.LastOrDefault(x => x.StartTime < Clock.CurrentTime);
|
|
}
|
|
}
|
|
}
|