mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 10:03:05 +08:00
Split classes
This commit is contained in:
parent
d0081908c5
commit
a1f880a36a
@ -222,20 +222,9 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
/// <returns>The <see cref="Skill"/>s.</returns>
|
/// <returns>The <see cref="Skill"/>s.</returns>
|
||||||
protected abstract Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate);
|
protected abstract Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate);
|
||||||
|
|
||||||
public class TimedDifficultyAttributes : IComparable<TimedDifficultyAttributes>
|
/// <summary>
|
||||||
{
|
/// Used to calculate timed difficulty attributes, where only a subset of hitobjects should be visible at any point in time.
|
||||||
public readonly double Time;
|
/// </summary>
|
||||||
public readonly DifficultyAttributes Attributes;
|
|
||||||
|
|
||||||
public TimedDifficultyAttributes(double time, DifficultyAttributes attributes)
|
|
||||||
{
|
|
||||||
Time = time;
|
|
||||||
Attributes = attributes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int CompareTo(TimedDifficultyAttributes other) => Time.CompareTo(other.Time);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ProgressiveCalculationBeatmap : IBeatmap
|
private class ProgressiveCalculationBeatmap : IBeatmap
|
||||||
{
|
{
|
||||||
private readonly IBeatmap baseBeatmap;
|
private readonly IBeatmap baseBeatmap;
|
||||||
|
25
osu.Game/Rulesets/Difficulty/TimedDifficultyAttributes.cs
Normal file
25
osu.Game/Rulesets/Difficulty/TimedDifficultyAttributes.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// 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;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Difficulty
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps a <see cref="DifficultyAttributes"/> object and adds a time value for which the attribute is valid.
|
||||||
|
/// Output by <see cref="DifficultyCalculator.CalculateTimed"/>.
|
||||||
|
/// </summary>
|
||||||
|
public class TimedDifficultyAttributes : IComparable<TimedDifficultyAttributes>
|
||||||
|
{
|
||||||
|
public readonly double Time;
|
||||||
|
public readonly DifficultyAttributes Attributes;
|
||||||
|
|
||||||
|
public TimedDifficultyAttributes(double time, DifficultyAttributes attributes)
|
||||||
|
{
|
||||||
|
Time = time;
|
||||||
|
Attributes = attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CompareTo(TimedDifficultyAttributes other) => Time.CompareTo(other.Time);
|
||||||
|
}
|
||||||
|
}
|
@ -40,7 +40,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private Player player { get; set; }
|
private Player player { get; set; }
|
||||||
|
|
||||||
private DifficultyCalculator.TimedDifficultyAttributes[] timedAttributes;
|
private TimedDifficultyAttributes[] timedAttributes;
|
||||||
private Ruleset gameplayRuleset;
|
private Ruleset gameplayRuleset;
|
||||||
|
|
||||||
public DefaultPerformancePointsCounter()
|
public DefaultPerformancePointsCounter()
|
||||||
@ -73,7 +73,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var attribIndex = Array.BinarySearch(timedAttributes, 0, timedAttributes.Length, new DifficultyCalculator.TimedDifficultyAttributes(judgement.HitObject.GetEndTime(), null));
|
var attribIndex = Array.BinarySearch(timedAttributes, 0, timedAttributes.Length, new TimedDifficultyAttributes(judgement.HitObject.GetEndTime(), null));
|
||||||
if (attribIndex < 0)
|
if (attribIndex < 0)
|
||||||
attribIndex = ~attribIndex - 1;
|
attribIndex = ~attribIndex - 1;
|
||||||
attribIndex = Math.Clamp(attribIndex, 0, timedAttributes.Length - 1);
|
attribIndex = Math.Clamp(attribIndex, 0, timedAttributes.Length - 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user