mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 12:03:21 +08:00
Return HitResult.None instead of null
This commit is contained in:
parent
c537af0289
commit
46284c61ae
@ -224,12 +224,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||||
if (result == null)
|
if (result == HitResult.None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddJudgement(new HoldNoteTailJudgement
|
AddJudgement(new HoldNoteTailJudgement
|
||||||
{
|
{
|
||||||
Result = result.Value,
|
Result = result,
|
||||||
HasBroken = holdNote.hasBroken
|
HasBroken = holdNote.hasBroken
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -68,10 +68,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||||
if (result == null)
|
if (result == HitResult.None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddJudgement(new ManiaJudgement { Result = result.Value });
|
AddJudgement(new ManiaJudgement { Result = result });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
|
@ -78,12 +78,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||||
if (result == null)
|
if (result == HitResult.None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddJudgement(new OsuJudgement
|
AddJudgement(new OsuJudgement
|
||||||
{
|
{
|
||||||
Result = result.Value,
|
Result = result,
|
||||||
PositionOffset = Vector2.Zero //todo: set to correct value
|
PositionOffset = Vector2.Zero //todo: set to correct value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||||
if (result == null)
|
if (result == HitResult.None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!validKeyPressed || result == HitResult.Miss)
|
if (!validKeyPressed || result == HitResult.Miss)
|
||||||
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
{
|
{
|
||||||
AddJudgement(new TaikoJudgement
|
AddJudgement(new TaikoJudgement
|
||||||
{
|
{
|
||||||
Result = result.Value,
|
Result = result,
|
||||||
Final = !HitObject.IsStrong
|
Final = !HitObject.IsStrong
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// Retrieves the <see cref="HitResult"/> for a time offset.
|
/// Retrieves the <see cref="HitResult"/> for a time offset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="timeOffset">The time offset.</param>
|
/// <param name="timeOffset">The time offset.</param>
|
||||||
/// <returns>The hit result, or null if <paramref name="timeOffset"/> doesn't result in a judgement.</returns>
|
/// <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)
|
public HitResult ResultFor(double timeOffset)
|
||||||
{
|
{
|
||||||
timeOffset = Math.Abs(timeOffset);
|
timeOffset = Math.Abs(timeOffset);
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
if (timeOffset <= HalfWindowFor(HitResult.Miss))
|
if (timeOffset <= HalfWindowFor(HitResult.Miss))
|
||||||
return HitResult.Miss;
|
return HitResult.Miss;
|
||||||
|
|
||||||
return null;
|
return HitResult.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user