mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Add LegacyContext
This commit is contained in:
@ -18,6 +18,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Beatmaps.Legacy;
|
||||
using osu.Game.Context;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -30,7 +31,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// HitObjects may contain more properties for which you should be checking through the IHas* types.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class HitObject
|
||||
public class HitObject : ContextContainer
|
||||
{
|
||||
/// <summary>
|
||||
/// A small adjustment to the start time of control points to account for rounding/precision errors.
|
||||
@ -81,12 +82,6 @@ namespace osu.Game.Rulesets.Objects
|
||||
public SampleControlPoint SampleControlPoint = SampleControlPoint.DEFAULT;
|
||||
public DifficultyControlPoint DifficultyControlPoint = DifficultyControlPoint.DEFAULT;
|
||||
|
||||
/// <summary>
|
||||
/// Legacy BPM multiplier that introduces floating-point errors for rulesets that depend on it.
|
||||
/// DO NOT USE THIS UNLESS 100% SURE.
|
||||
/// </summary>
|
||||
public double? LegacyBpmMultiplier { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether this <see cref="HitObject"/> is in Kiai time.
|
||||
/// </summary>
|
||||
@ -174,12 +169,6 @@ namespace osu.Game.Rulesets.Objects
|
||||
{
|
||||
var legacyInfo = controlPointInfo as LegacyControlPointInfo;
|
||||
|
||||
DifficultyControlPoint difficultyControlPoint = legacyInfo != null ? legacyInfo.DifficultyPointAt(StartTime) : DifficultyControlPoint.DEFAULT;
|
||||
#pragma warning disable 618
|
||||
if (difficultyControlPoint is LegacyBeatmapDecoder.LegacyDifficultyControlPoint legacyDifficultyControlPoint)
|
||||
#pragma warning restore 618
|
||||
LegacyBpmMultiplier = legacyDifficultyControlPoint.BpmMultiplier;
|
||||
|
||||
ApplyLegacyInfoToSelf(controlPointInfo, difficulty);
|
||||
|
||||
// This is done here after ApplyLegacyInfoToSelf as we may require custom defaults to be applied to have an accurate end time.
|
||||
|
Reference in New Issue
Block a user