mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 03:52:56 +08:00
Use AsNonNull()
instead.
This commit is contained in:
parent
59c83a3423
commit
0a1543c6e8
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@ -94,7 +95,7 @@ namespace osu.Game.Rulesets.Mania.Replays
|
|||||||
bool canDelayKeyUpFully = nextObject == null ||
|
bool canDelayKeyUpFully = nextObject == null ||
|
||||||
nextObject.StartTime > endTime + RELEASE_DELAY;
|
nextObject.StartTime > endTime + RELEASE_DELAY;
|
||||||
|
|
||||||
return endTime + (canDelayKeyUpFully ? RELEASE_DELAY : (nextObject!.StartTime - endTime) * 0.9);
|
return endTime + (canDelayKeyUpFully ? RELEASE_DELAY : (nextObject.AsNonNull().StartTime - endTime) * 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override HitObject? GetNextObject(int currentIndex)
|
protected override HitObject? GetNextObject(int currentIndex)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
@ -117,7 +118,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
|||||||
var nextHitObject = GetNextObject(i); // Get the next object that requires pressing the same button
|
var nextHitObject = GetNextObject(i); // Get the next object that requires pressing the same button
|
||||||
|
|
||||||
bool canDelayKeyUp = nextHitObject == null || nextHitObject.StartTime > endTime + KEY_UP_DELAY;
|
bool canDelayKeyUp = nextHitObject == null || nextHitObject.StartTime > endTime + KEY_UP_DELAY;
|
||||||
double calculatedDelay = canDelayKeyUp ? KEY_UP_DELAY : (nextHitObject!.StartTime - endTime) * 0.9;
|
double calculatedDelay = canDelayKeyUp ? KEY_UP_DELAY : (nextHitObject.AsNonNull().StartTime - endTime) * 0.9;
|
||||||
Frames.Add(new TaikoReplayFrame(endTime + calculatedDelay));
|
Frames.Add(new TaikoReplayFrame(endTime + calculatedDelay));
|
||||||
|
|
||||||
hitButton = !hitButton;
|
hitButton = !hitButton;
|
||||||
|
@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Development;
|
using osu.Framework.Development;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -188,7 +189,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (frame is IConvertibleReplayFrame convertible)
|
if (frame is IConvertibleReplayFrame convertible)
|
||||||
pendingFrames.Enqueue(convertible.ToLegacy(currentBeatmap!));
|
pendingFrames.Enqueue(convertible.ToLegacy(currentBeatmap.AsNonNull()));
|
||||||
|
|
||||||
if (pendingFrames.Count > max_pending_frames)
|
if (pendingFrames.Count > max_pending_frames)
|
||||||
purgePendingFrames();
|
purgePendingFrames();
|
||||||
|
@ -6,6 +6,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Formats;
|
using osu.Game.Beatmaps.Formats;
|
||||||
using osu.Game.Extensions;
|
using osu.Game.Extensions;
|
||||||
@ -143,7 +144,7 @@ namespace osu.Game.Scoring.Legacy
|
|||||||
return legacyFrame;
|
return legacyFrame;
|
||||||
|
|
||||||
case IConvertibleReplayFrame convertibleFrame:
|
case IConvertibleReplayFrame convertibleFrame:
|
||||||
return convertibleFrame.ToLegacy(beatmap!);
|
return convertibleFrame.ToLegacy(beatmap.AsNonNull());
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new ArgumentException(@"Frame could not be converted to legacy frames", nameof(replayFrame));
|
throw new ArgumentException(@"Frame could not be converted to legacy frames", nameof(replayFrame));
|
||||||
|
Loading…
Reference in New Issue
Block a user