mirror of
https://github.com/osukey/osukey.git
synced 2025-06-17 09:18:06 +09:00
Fix naming and update in line with nullability
This commit is contained in:
parent
210c5e7c53
commit
cb7b246e33
@ -19,18 +19,19 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public virtual bool PerformFail() => true;
|
public virtual bool PerformFail() => true;
|
||||||
|
|
||||||
public virtual bool RestartOnFail => Restart.Value;
|
public virtual bool RestartOnFail => Restart.Value;
|
||||||
private event Action failureTriggered;
|
|
||||||
|
private Action? triggerFailureDelegate;
|
||||||
|
|
||||||
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
|
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
|
||||||
{
|
{
|
||||||
failureTriggered = healthProcessor.TriggerFailure;
|
triggerFailureDelegate = healthProcessor.TriggerFailure;
|
||||||
healthProcessor.FailConditions += FailCondition;
|
healthProcessor.FailConditions += FailCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Immediately triggers a failure on the loaded <see cref="HealthProcessor"/>.
|
/// Immediately triggers a failure on the loaded <see cref="HealthProcessor"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void TriggerFailure() => failureTriggered?.Invoke();
|
protected void TriggerFailure() => triggerFailureDelegate?.Invoke();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether <paramref name="result"/> should trigger a failure. Called every time a
|
/// Determines whether <paramref name="result"/> should trigger a failure. Called every time a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user