Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions PerformanceCalculatorGUI/ExtendedCatchDifficultyCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// 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.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Catch.Difficulty;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods;
Expand All @@ -15,19 +15,26 @@ namespace PerformanceCalculatorGUI
public class ExtendedCatchDifficultyCalculator : CatchDifficultyCalculator, IExtendedDifficultyCalculator
{
private Skill[] skills = [];
private DifficultyHitObject[] difficultyHitObjects = [];

public ExtendedCatchDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
: base(ruleset, beatmap)
{
}

public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate) => CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
{
this.skills = skills;
return base.CreateDifficultyAttributes(beatmap, mods, skills, clockRate);
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
return skills;
}
}
}
17 changes: 12 additions & 5 deletions PerformanceCalculatorGUI/ExtendedManiaDifficultyCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 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.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mania.Difficulty;
Expand All @@ -15,19 +15,26 @@ namespace PerformanceCalculatorGUI
public class ExtendedManiaDifficultyCalculator : ManiaDifficultyCalculator, IExtendedDifficultyCalculator
{
private Skill[] skills = [];
private DifficultyHitObject[] difficultyHitObjects = [];

public ExtendedManiaDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
: base(ruleset, beatmap)
{
}

public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate) => CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
{
this.skills = skills;
return base.CreateDifficultyAttributes(beatmap, mods, skills, clockRate);
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
return skills;
}
}
}
17 changes: 12 additions & 5 deletions PerformanceCalculatorGUI/ExtendedOsuDifficultyCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 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.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods;
Expand All @@ -15,19 +15,26 @@ namespace PerformanceCalculatorGUI
public class ExtendedOsuDifficultyCalculator : OsuDifficultyCalculator, IExtendedDifficultyCalculator
{
private Skill[] skills = [];
private DifficultyHitObject[] difficultyHitObjects = [];

public ExtendedOsuDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
: base(ruleset, beatmap)
{
}

public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate) => CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
{
this.skills = skills;
return base.CreateDifficultyAttributes(beatmap, mods, skills, clockRate);
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
return skills;
}
}
}
17 changes: 12 additions & 5 deletions PerformanceCalculatorGUI/ExtendedTaikoDifficultyCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 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.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods;
Expand All @@ -15,19 +15,26 @@ namespace PerformanceCalculatorGUI
public class ExtendedTaikoDifficultyCalculator : TaikoDifficultyCalculator, IExtendedDifficultyCalculator
{
private Skill[] skills = [];
private DifficultyHitObject[] difficultyHitObjects = [];

public ExtendedTaikoDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
: base(ruleset, beatmap)
{
}

public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate) => CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
{
this.skills = skills;
return base.CreateDifficultyAttributes(beatmap, mods, skills, clockRate);
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
return skills;
}
}
}
3 changes: 1 addition & 2 deletions PerformanceCalculatorGUI/IExtendedDifficultyCalculator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// 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 osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;

Expand All @@ -10,6 +9,6 @@ namespace PerformanceCalculatorGUI
public interface IExtendedDifficultyCalculator
{
Skill[] GetSkills();
DifficultyHitObject[] GetDifficultyHitObjects(IBeatmap beatmap, double clockRate);
DifficultyHitObject[] GetDifficultyHitObjects();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,41 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
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.Difficulty;
using osu.Game.Rulesets.Mods;

namespace PerformanceCalculatorGUI.Screens.ObjectInspection
{
public partial class CatchObjectInspectorRuleset : DrawableCatchEditorRuleset
{
private readonly CatchDifficultyHitObject[] difficultyHitObjects;
private CatchDifficultyHitObject[] difficultyHitObjects = [];

[Resolved]
private ObjectDifficultyValuesContainer objectDifficultyValuesContainer { get; set; } = null!;

public CatchObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods, ExtendedCatchDifficultyCalculator difficultyCalculator, double clockRate)
[Resolved]
private Bindable<DifficultyCalculator?> difficultyCalculator { get; set; } = null!;

public CatchObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
: base(ruleset, beatmap, mods)
{
difficultyHitObjects = difficultyCalculator.GetDifficultyHitObjects(beatmap, clockRate)
.Cast<CatchDifficultyHitObject>().ToArray();
}

protected override void LoadComplete()
{
var extendedDifficultyCalculator = (IExtendedDifficultyCalculator?)difficultyCalculator.Value;

if (extendedDifficultyCalculator != null)
{
difficultyHitObjects = extendedDifficultyCalculator.GetDifficultyHitObjects().Cast<CatchDifficultyHitObject>().ToArray();
}

base.LoadComplete();
}

public override bool PropagatePositionalInputSubTree => false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using osu.Game.Rulesets.Catch.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
Expand Down Expand Up @@ -54,9 +53,6 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
[Resolved]
private Bindable<RulesetInfo> ruleset { get; set; } = null!;

[Resolved]
private Bindable<DifficultyCalculator> difficultyCalculator { get; set; } = null!;

private readonly ProcessorWorkingBeatmap processorBeatmap;
private EditorClock clock = null!;
private Container rulesetContainer = null!;
Expand Down Expand Up @@ -205,8 +201,7 @@ private void load(OverlayColourProvider colourProvider)
RelativeSizeAxes = Axes.Both,
PlayfieldBorderStyle = { Value = PlayfieldBorderStyle.Corners }
},
new OsuObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods!, (difficultyCalculator.Value as ExtendedOsuDifficultyCalculator)!,
processorBeatmap.Track.Rate)
new OsuObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods!)
{
RelativeSizeAxes = Axes.Both,
Clock = clock,
Expand All @@ -216,8 +211,7 @@ private void load(OverlayColourProvider colourProvider)
},
"taiko" => new TaikoPlayfieldAdjustmentContainer
{
Child = new TaikoObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods!, (difficultyCalculator.Value as ExtendedTaikoDifficultyCalculator)!,
processorBeatmap.Track.Rate)
Child = new TaikoObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods!)
{
RelativeSizeAxes = Axes.Both,
Clock = clock,
Expand All @@ -230,8 +224,7 @@ private void load(OverlayColourProvider colourProvider)
Y = 100,
Children = new Drawable[]
{
new CatchObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods!, (difficultyCalculator.Value as ExtendedCatchDifficultyCalculator)!,
processorBeatmap.Track.Rate)
new CatchObjectInspectorRuleset(rulesetInstance, playableBeatmap, modifiedMods!)
{
RelativeSizeAxes = Axes.Both,
Clock = clock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
Expand All @@ -20,15 +22,29 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
{
public partial class OsuObjectInspectorRuleset : DrawableOsuEditorRuleset
{
private readonly OsuDifficultyHitObject[] difficultyHitObjects;
private OsuDifficultyHitObject[] difficultyHitObjects = [];

[Resolved]
private ObjectDifficultyValuesContainer objectDifficultyValuesContainer { get; set; } = null!;

public OsuObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods, ExtendedOsuDifficultyCalculator difficultyCalculator, double clockRate)
[Resolved]
private Bindable<DifficultyCalculator?> difficultyCalculator { get; set; } = null!;

public OsuObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
: base(ruleset, beatmap, mods)
{
difficultyHitObjects = difficultyCalculator.GetDifficultyHitObjects(beatmap, clockRate).Cast<OsuDifficultyHitObject>().ToArray();
}

protected override void LoadComplete()
{
var extendedDifficultyCalculator = (IExtendedDifficultyCalculator?)difficultyCalculator.Value;

if (extendedDifficultyCalculator != null)
{
difficultyHitObjects = extendedDifficultyCalculator.GetDifficultyHitObjects().Cast<OsuDifficultyHitObject>().ToArray();
}

base.LoadComplete();
}

protected override void Update()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
using osu.Game.Rulesets.Taiko.Edit;
Expand All @@ -16,20 +18,32 @@ namespace PerformanceCalculatorGUI.Screens.ObjectInspection
{
public partial class TaikoObjectInspectorRuleset : DrawableTaikoEditorRuleset
{
private readonly TaikoDifficultyHitObject[] difficultyHitObjects;
private TaikoDifficultyHitObject[] difficultyHitObjects = [];

[Resolved]
private ObjectDifficultyValuesContainer objectDifficultyValuesContainer { get; set; } = null!;

public TaikoObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods, ExtendedTaikoDifficultyCalculator difficultyCalculator, double clockRate)
[Resolved]
private Bindable<DifficultyCalculator?> difficultyCalculator { get; set; } = null!;

public TaikoObjectInspectorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
: base(ruleset, beatmap, mods)
{
difficultyHitObjects = difficultyCalculator.GetDifficultyHitObjects(beatmap, clockRate)
.Cast<TaikoDifficultyHitObject>().ToArray();

ShowSpeedChanges.Value = true;
}

protected override void LoadComplete()
{
var extendedDifficultyCalculator = (IExtendedDifficultyCalculator?)difficultyCalculator.Value;

if (extendedDifficultyCalculator != null)
{
difficultyHitObjects = extendedDifficultyCalculator.GetDifficultyHitObjects().Cast<TaikoDifficultyHitObject>().ToArray();
}

base.LoadComplete();
}

public override bool PropagatePositionalInputSubTree => false;

public override bool PropagateNonPositionalInputSubTree => false;
Expand Down
Loading