1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:13:21 +08:00

Return HitResult.None instead of null

This commit is contained in:
smoogipoo 2018-02-08 14:25:59 +09:00
parent c537af0289
commit 46284c61ae
5 changed files with 11 additions and 11 deletions

View File

@ -224,12 +224,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
}
var result = HitObject.HitWindows.ResultFor(timeOffset);
if (result == null)
if (result == HitResult.None)
return;
AddJudgement(new HoldNoteTailJudgement
{
Result = result.Value,
Result = result,
HasBroken = holdNote.hasBroken
});
}

View File

@ -68,10 +68,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
}
var result = HitObject.HitWindows.ResultFor(timeOffset);
if (result == null)
if (result == HitResult.None)
return;
AddJudgement(new ManiaJudgement { Result = result.Value });
AddJudgement(new ManiaJudgement { Result = result });
}
protected override void UpdateState(ArmedState state)

View File

@ -78,12 +78,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
var result = HitObject.HitWindows.ResultFor(timeOffset);
if (result == null)
if (result == HitResult.None)
return;
AddJudgement(new OsuJudgement
{
Result = result.Value,
Result = result,
PositionOffset = Vector2.Zero //todo: set to correct value
});
}

View File

@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
}
var result = HitObject.HitWindows.ResultFor(timeOffset);
if (result == null)
if (result == HitResult.None)
return;
if (!validKeyPressed || result == HitResult.Miss)
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
AddJudgement(new TaikoJudgement
{
Result = result.Value,
Result = result,
Final = !HitObject.IsStrong
});

View File

@ -80,8 +80,8 @@ namespace osu.Game.Rulesets.Objects
/// Retrieves the <see cref="HitResult"/> for a time offset.
/// </summary>
/// <param name="timeOffset">The time offset.</param>
/// <returns>The hit result, or null if <paramref name="timeOffset"/> doesn't result in a judgement.</returns>
public HitResult? ResultFor(double timeOffset)
/// <returns>The hit result, or <see cref="HitResult.None"/> if <paramref name="timeOffset"/> doesn't result in a judgement.</returns>
public HitResult ResultFor(double timeOffset)
{
timeOffset = Math.Abs(timeOffset);
@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Objects
if (timeOffset <= HalfWindowFor(HitResult.Miss))
return HitResult.Miss;
return null;
return HitResult.None;
}
/// <summary>