mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Merge pull request #12347 from smoogipoo/remove-obsoletes
Remove obsolete code
This commit is contained in:
commit
a4b4033bf0
@ -27,8 +27,6 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public IBeatmap Beatmap { get; }
|
public IBeatmap Beatmap { get; }
|
||||||
|
|
||||||
private CancellationToken cancellationToken;
|
|
||||||
|
|
||||||
protected BeatmapConverter(IBeatmap beatmap, Ruleset ruleset)
|
protected BeatmapConverter(IBeatmap beatmap, Ruleset ruleset)
|
||||||
{
|
{
|
||||||
Beatmap = beatmap;
|
Beatmap = beatmap;
|
||||||
@ -41,8 +39,6 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public IBeatmap Convert(CancellationToken cancellationToken = default)
|
public IBeatmap Convert(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
this.cancellationToken = cancellationToken;
|
|
||||||
|
|
||||||
// We always operate on a clone of the original beatmap, to not modify it game-wide
|
// We always operate on a clone of the original beatmap, to not modify it game-wide
|
||||||
return ConvertBeatmap(Beatmap.Clone(), cancellationToken);
|
return ConvertBeatmap(Beatmap.Clone(), cancellationToken);
|
||||||
}
|
}
|
||||||
@ -55,19 +51,6 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <returns>The converted Beatmap.</returns>
|
/// <returns>The converted Beatmap.</returns>
|
||||||
protected virtual Beatmap<T> ConvertBeatmap(IBeatmap original, CancellationToken cancellationToken)
|
protected virtual Beatmap<T> ConvertBeatmap(IBeatmap original, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
#pragma warning disable 618
|
|
||||||
return ConvertBeatmap(original);
|
|
||||||
#pragma warning restore 618
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs the conversion of a Beatmap using this Beatmap Converter.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="original">The un-converted Beatmap.</param>
|
|
||||||
/// <returns>The converted Beatmap.</returns>
|
|
||||||
[Obsolete("Use the cancellation-supporting override")] // Can be removed 20210318
|
|
||||||
protected virtual Beatmap<T> ConvertBeatmap(IBeatmap original)
|
|
||||||
{
|
|
||||||
var beatmap = CreateBeatmap();
|
var beatmap = CreateBeatmap();
|
||||||
|
|
||||||
beatmap.BeatmapInfo = original.BeatmapInfo;
|
beatmap.BeatmapInfo = original.BeatmapInfo;
|
||||||
@ -121,21 +104,6 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <param name="beatmap">The un-converted Beatmap.</param>
|
/// <param name="beatmap">The un-converted Beatmap.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>The converted hit object.</returns>
|
/// <returns>The converted hit object.</returns>
|
||||||
protected virtual IEnumerable<T> ConvertHitObject(HitObject original, IBeatmap beatmap, CancellationToken cancellationToken)
|
protected virtual IEnumerable<T> ConvertHitObject(HitObject original, IBeatmap beatmap, CancellationToken cancellationToken) => Enumerable.Empty<T>();
|
||||||
{
|
|
||||||
#pragma warning disable 618
|
|
||||||
return ConvertHitObject(original, beatmap);
|
|
||||||
#pragma warning restore 618
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs the conversion of a hit object.
|
|
||||||
/// This method is generally executed sequentially for all objects in a beatmap.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="original">The hit object to convert.</param>
|
|
||||||
/// <param name="beatmap">The un-converted Beatmap.</param>
|
|
||||||
/// <returns>The converted hit object.</returns>
|
|
||||||
[Obsolete("Use the cancellation-supporting override")] // Can be removed 20210318
|
|
||||||
protected virtual IEnumerable<T> ConvertHitObject(HitObject original, IBeatmap beatmap) => Enumerable.Empty<T>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,16 +3,11 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osuTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
{
|
{
|
||||||
public class BeatmapStatistic
|
public class BeatmapStatistic
|
||||||
{
|
{
|
||||||
[Obsolete("Use CreateIcon instead")] // can be removed 20210203
|
|
||||||
public IconUsage Icon = FontAwesome.Regular.QuestionCircle;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A function to create the icon for display purposes. Use default icons available via <see cref="BeatmapStatisticIcon"/> whenever possible for conformity.
|
/// A function to create the icon for display purposes. Use default icons available via <see cref="BeatmapStatisticIcon"/> whenever possible for conformity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -20,12 +15,5 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public string Content;
|
public string Content;
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
public BeatmapStatistic()
|
|
||||||
{
|
|
||||||
#pragma warning disable 618
|
|
||||||
CreateIcon = () => new SpriteIcon { Icon = Icon, Scale = new Vector2(0.7f) };
|
|
||||||
#pragma warning restore 618
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,13 +57,6 @@ namespace osu.Game.Overlays.Settings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use Current instead")] // Can be removed 20210406
|
|
||||||
public Bindable<T> Bindable
|
|
||||||
{
|
|
||||||
get => Current;
|
|
||||||
set => Current = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual Bindable<T> Current
|
public virtual Bindable<T> Current
|
||||||
{
|
{
|
||||||
get => controlWithCurrent.Current;
|
get => controlWithCurrent.Current;
|
||||||
|
@ -28,18 +28,6 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected const double DEFAULT_MAX_HEALTH_INCREASE = 0.05;
|
protected const double DEFAULT_MAX_HEALTH_INCREASE = 0.05;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether this <see cref="Judgement"/> should affect the current combo.
|
|
||||||
/// </summary>
|
|
||||||
[Obsolete("Has no effect. Use HitResult members instead (e.g. use small-tick or bonus to not affect combo).")] // Can be removed 20210328
|
|
||||||
public virtual bool AffectsCombo => true;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether this <see cref="Judgement"/> should be counted as base (combo) or bonus score.
|
|
||||||
/// </summary>
|
|
||||||
[Obsolete("Has no effect. Use HitResult members instead (e.g. use small-tick or bonus to not affect combo).")] // Can be removed 20210328
|
|
||||||
public virtual bool IsBonus => !AffectsCombo;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum <see cref="HitResult"/> that can be achieved.
|
/// The maximum <see cref="HitResult"/> that can be achieved.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -11,7 +11,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.TypeExtensions;
|
using osu.Framework.Extensions.TypeExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Logging;
|
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
@ -736,24 +735,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
if (!Result.HasResult)
|
if (!Result.HasResult)
|
||||||
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
|
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
|
||||||
|
|
||||||
// Some (especially older) rulesets use scorable judgements instead of the newer ignorehit/ignoremiss judgements.
|
|
||||||
// Can be removed 20210328
|
|
||||||
if (Result.Judgement.MaxResult == HitResult.IgnoreHit)
|
|
||||||
{
|
|
||||||
HitResult originalType = Result.Type;
|
|
||||||
|
|
||||||
if (Result.Type == HitResult.Miss)
|
|
||||||
Result.Type = HitResult.IgnoreMiss;
|
|
||||||
else if (Result.Type >= HitResult.Meh && Result.Type <= HitResult.Perfect)
|
|
||||||
Result.Type = HitResult.IgnoreHit;
|
|
||||||
|
|
||||||
if (Result.Type != originalType)
|
|
||||||
{
|
|
||||||
Logger.Log($"{GetType().ReadableName()} applied an invalid hit result ({originalType}) when {nameof(HitResult.IgnoreMiss)} or {nameof(HitResult.IgnoreHit)} is expected.\n"
|
|
||||||
+ $"This has been automatically adjusted to {Result.Type}, and support will be removed from 2021-03-28 onwards.", level: LogLevel.Important);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Result.Type.IsValidHitResult(Result.Judgement.MinResult, Result.Judgement.MaxResult))
|
if (!Result.Type.IsValidHitResult(Result.Judgement.MinResult, Result.Judgement.MaxResult))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
|
@ -139,15 +139,6 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CreateNestedHitObjects(CancellationToken cancellationToken)
|
protected virtual void CreateNestedHitObjects(CancellationToken cancellationToken)
|
||||||
{
|
|
||||||
// ReSharper disable once MethodSupportsCancellation (https://youtrack.jetbrains.com/issue/RIDER-44520)
|
|
||||||
#pragma warning disable 618
|
|
||||||
CreateNestedHitObjects();
|
|
||||||
#pragma warning restore 618
|
|
||||||
}
|
|
||||||
|
|
||||||
[Obsolete("Use the cancellation-supporting override")] // Can be removed 20210318
|
|
||||||
protected virtual void CreateNestedHitObjects()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,12 +346,6 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
score.HitEvents = hitEvents;
|
score.HitEvents = hitEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create a <see cref="HitWindows"/> for this processor.
|
|
||||||
/// </summary>
|
|
||||||
[Obsolete("Method is now unused.")] // Can be removed 20210328
|
|
||||||
public virtual HitWindows CreateHitWindows() => new HitWindows();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ScoringMode
|
public enum ScoringMode
|
||||||
|
Loading…
Reference in New Issue
Block a user