mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Autodetect LowestSuccessfulHitResult
This commit is contained in:
parent
e49e2fda9e
commit
28b033bd99
@ -17,8 +17,6 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
{ HitResult.Miss, (270, 190, 140) },
|
{ HitResult.Miss, (270, 190, 140) },
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override HitResult LowestSuccessfulHitResult => HitResult.Good;
|
|
||||||
|
|
||||||
public override bool IsHitResultAllowed(HitResult result)
|
public override bool IsHitResultAllowed(HitResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
|
@ -51,9 +51,19 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
public double Miss { get; protected set; }
|
public double Miss { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="HitResult"/> with the largest hit window that produces a successful hit.
|
/// Retrieves the <see cref="HitResult"/> with the largest hit window that produces a successful hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual HitResult LowestSuccessfulHitResult => HitResult.Meh;
|
/// <returns>The lowest allowed successful <see cref="HitResult"/>.</returns>
|
||||||
|
protected HitResult LowestSuccessfulHitResult()
|
||||||
|
{
|
||||||
|
for (var result = HitResult.Meh; result <= HitResult.Perfect; ++result)
|
||||||
|
{
|
||||||
|
if (IsHitResultAllowed(result))
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return HitResult.None;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check whether it is possible to achieve the provided <see cref="HitResult"/>.
|
/// Check whether it is possible to achieve the provided <see cref="HitResult"/>.
|
||||||
@ -137,6 +147,6 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="timeOffset">The time offset.</param>
|
/// <param name="timeOffset">The time offset.</param>
|
||||||
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
|
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
|
||||||
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(LowestSuccessfulHitResult);
|
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(LowestSuccessfulHitResult());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user