1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00
This commit is contained in:
Huo Yaoyuan 2019-11-12 18:35:08 +08:00
parent 2270f33c33
commit dcfa98414f
7 changed files with 10 additions and 10 deletions

View File

@ -148,9 +148,9 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
protected int FindAvailableColumn(int initialColumn, int? lowerBound = null, int? upperBound = null, Func<int, int> nextColumn = null, [InstantHandle] Func<int, bool> validation = null,
params Pattern[] patterns)
{
lowerBound = lowerBound ?? RandomStart;
upperBound = upperBound ?? TotalColumns;
nextColumn = nextColumn ?? (_ => GetRandomColumn(lowerBound, upperBound));
lowerBound ??= RandomStart;
upperBound ??= TotalColumns;
nextColumn ??= (_ => GetRandomColumn(lowerBound, upperBound));
// Check for the initial column
if (isValid(initialColumn))

View File

@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Tests
private Drawable testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2? positionOffset = null)
{
positionOffset = positionOffset ?? Vector2.Zero;
positionOffset ??= Vector2.Zero;
var circle = new HitCircle
{

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected sealed override double InitialLifetimeOffset => HitObject.TimePreempt;
private OsuInputManager osuActionInputManager;
internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager);
internal OsuInputManager OsuActionInputManager => osuActionInputManager ??= GetContainingInputManager() as OsuInputManager;
protected virtual void Shake(double maximumLength) => shakeContainer.Shake(maximumLength);

View File

@ -84,7 +84,7 @@ namespace osu.Game.Beatmaps
{
try
{
return (trackStore ?? (trackStore = AudioManager.GetTrackStore(store))).Get(getPathForFile(Metadata.AudioFile));
return (trackStore ??= AudioManager.GetTrackStore(store)).Get(getPathForFile(Metadata.AudioFile));
}
catch
{

View File

@ -150,7 +150,7 @@ namespace osu.Game.Beatmaps
public bool BeatmapLoaded => beatmapLoadTask?.IsCompleted ?? false;
public Task<IBeatmap> LoadBeatmapAsync() => (beatmapLoadTask ?? (beatmapLoadTask = Task.Factory.StartNew(() =>
public Task<IBeatmap> LoadBeatmapAsync() => beatmapLoadTask ??= Task.Factory.StartNew(() =>
{
// Todo: Handle cancellation during beatmap parsing
var b = GetBeatmap() ?? new Beatmap();
@ -162,7 +162,7 @@ namespace osu.Game.Beatmaps
b.BeatmapInfo = BeatmapInfo;
return b;
}, beatmapCancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default)));
}, beatmapCancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
public IBeatmap Beatmap
{

View File

@ -129,7 +129,7 @@ namespace osu.Game.Rulesets.Objects
isInitialised = true;
controlPoints = controlPoints ?? Array.Empty<Vector2>();
controlPoints ??= Array.Empty<Vector2>();
calculatedPath = new List<Vector2>();
cumulativeLength = new List<double>();

View File

@ -96,7 +96,7 @@ namespace osu.Game.Skinning
else
{
model.Name = model.Name.Replace(".osk", "");
model.Creator = model.Creator ?? "Unknown";
model.Creator ??= "Unknown";
}
}