1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:43:00 +08:00

Rename CatcherArea.MovableCatcher to Catcher

This commit is contained in:
ekrctb 2021-07-21 16:28:31 +09:00
parent da3499f10e
commit 94678064ff
3 changed files with 17 additions and 17 deletions

View File

@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Catch.Tests
{
area.OnNewResult(drawable, new CatchJudgementResult(fruit, new CatchJudgement())
{
Type = area.MovableCatcher.CanCatch(fruit) ? HitResult.Great : HitResult.Miss
Type = area.Catcher.CanCatch(fruit) ? HitResult.Great : HitResult.Miss
});
drawable.Expire();
@ -125,13 +125,13 @@ namespace osu.Game.Rulesets.Catch.Tests
Add(droppedObjectContainer);
MovableCatcher = new Catcher(this, droppedObjectContainer, beatmapDifficulty)
Catcher = new Catcher(this, droppedObjectContainer, beatmapDifficulty)
{
X = CatchPlayfield.CENTER_X
};
}
public void ToggleHyperDash(bool status) => MovableCatcher.SetHyperDashState(status ? 2 : 1);
public void ToggleHyperDash(bool status) => Catcher.SetHyperDashState(status ? 2 : 1);
}
}
}

View File

@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Catch.UI
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.TopLeft,
MovableCatcher = Catcher,
Catcher = Catcher,
},
trailContainer,
HitObjectContainer,

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.UI
{
public const float CATCHER_SIZE = 106.75f;
public Catcher MovableCatcher
public Catcher Catcher
{
get => catcher;
set
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Catch.UI
public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result)
{
MovableCatcher.OnNewResult(hitObject, result);
Catcher.OnNewResult(hitObject, result);
if (!result.Type.IsScorable())
return;
@ -66,9 +66,9 @@ namespace osu.Game.Rulesets.Catch.UI
if (hitObject.HitObject.LastInCombo)
{
if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result))
MovableCatcher.Explode();
Catcher.Explode();
else
MovableCatcher.Drop();
Catcher.Drop();
}
comboDisplay.OnNewResult(hitObject, result);
@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Catch.UI
public void OnRevertResult(DrawableCatchHitObject hitObject, JudgementResult result)
{
comboDisplay.OnRevertResult(hitObject, result);
MovableCatcher.OnRevertResult(hitObject, result);
Catcher.OnRevertResult(hitObject, result);
}
protected override void Update()
@ -88,27 +88,27 @@ namespace osu.Game.Rulesets.Catch.UI
SetCatcherPosition(
replayState?.CatcherX ??
(float)(MovableCatcher.X + MovableCatcher.Speed * currentDirection * Clock.ElapsedFrameTime));
(float)(Catcher.X + Catcher.Speed * currentDirection * Clock.ElapsedFrameTime));
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
comboDisplay.X = MovableCatcher.X;
comboDisplay.X = Catcher.X;
}
public void SetCatcherPosition(float X)
{
float lastPosition = MovableCatcher.X;
float lastPosition = Catcher.X;
float newPosition = Math.Clamp(X, 0, CatchPlayfield.WIDTH);
MovableCatcher.X = newPosition;
Catcher.X = newPosition;
if (lastPosition < newPosition)
MovableCatcher.VisualDirection = Direction.Right;
Catcher.VisualDirection = Direction.Right;
else if (lastPosition > newPosition)
MovableCatcher.VisualDirection = Direction.Left;
Catcher.VisualDirection = Direction.Left;
}
public bool OnPressed(CatchAction action)
@ -124,7 +124,7 @@ namespace osu.Game.Rulesets.Catch.UI
return true;
case CatchAction.Dash:
MovableCatcher.Dashing = true;
Catcher.Dashing = true;
return true;
}
@ -144,7 +144,7 @@ namespace osu.Game.Rulesets.Catch.UI
break;
case CatchAction.Dash:
MovableCatcher.Dashing = false;
Catcher.Dashing = false;
break;
}
}