Privatise some fields

This commit is contained in:
Dean Herbert
2022-07-13 22:04:57 +09:00
parent 5e6b9b96b0
commit 33dd9562cc

View File

@ -26,19 +26,19 @@ namespace osu.Game.Rulesets.Osu.Mods
protected const double FLASH_DURATION = 1000; protected const double FLASH_DURATION = 1000;
protected DrawableRuleset<OsuHitObject> Ruleset = null!;
protected OsuAction? LastActionPressed;
/// <summary> /// <summary>
/// A tracker for periods where alternate should not be forced (i.e. non-gameplay periods). /// A tracker for periods where alternate should not be forced (i.e. non-gameplay periods).
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// This is different from <see cref="Player.IsBreakTime"/> in that the periods here end strictly at the first object after the break, rather than the break's end time. /// This is different from <see cref="Player.IsBreakTime"/> in that the periods here end strictly at the first object after the break, rather than the break's end time.
/// </remarks> /// </remarks>
protected PeriodTracker NonGameplayPeriods = null!; private PeriodTracker nonGameplayPeriods = null!;
protected DrawableRuleset<OsuHitObject> Ruleset = null!; private IFrameStableClock gameplayClock = null!;
protected IFrameStableClock GameplayClock = null!;
protected OsuAction? LastActionPressed;
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset) public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{ {
@ -57,14 +57,14 @@ namespace osu.Game.Rulesets.Osu.Mods
static double getValidJudgementTime(HitObject hitObject) => hitObject.StartTime - hitObject.HitWindows.WindowFor(HitResult.Meh); static double getValidJudgementTime(HitObject hitObject) => hitObject.StartTime - hitObject.HitWindows.WindowFor(HitResult.Meh);
} }
NonGameplayPeriods = new PeriodTracker(periods); nonGameplayPeriods = new PeriodTracker(periods);
GameplayClock = drawableRuleset.FrameStableClock; gameplayClock = drawableRuleset.FrameStableClock;
} }
protected virtual bool CheckCorrectAction(OsuAction action) protected virtual bool CheckCorrectAction(OsuAction action)
{ {
if (NonGameplayPeriods.IsInAny(GameplayClock.CurrentTime)) if (nonGameplayPeriods.IsInAny(gameplayClock.CurrentTime))
{ {
LastActionPressed = null; LastActionPressed = null;
return true; return true;