mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Remove X setter from CatchHitObject
This commit is contained in:
parent
f621d977fc
commit
7cbbd74df2
@ -32,22 +32,22 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
|
||||
{
|
||||
new Fruit
|
||||
{
|
||||
X = CatchPlayfield.CENTER_X,
|
||||
OriginalX = CatchPlayfield.CENTER_X,
|
||||
StartTime = 0
|
||||
},
|
||||
new Fruit
|
||||
{
|
||||
X = 0,
|
||||
OriginalX = 0,
|
||||
StartTime = 1000
|
||||
},
|
||||
new Fruit
|
||||
{
|
||||
X = CatchPlayfield.WIDTH,
|
||||
OriginalX = CatchPlayfield.WIDTH,
|
||||
StartTime = 2000
|
||||
},
|
||||
new JuiceStream
|
||||
{
|
||||
X = CatchPlayfield.CENTER_X,
|
||||
OriginalX = CatchPlayfield.CENTER_X,
|
||||
StartTime = 3000,
|
||||
Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, Vector2.UnitY * 200 })
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
|
||||
beatmap.HitObjects.Add(new JuiceStream
|
||||
{
|
||||
X = CatchPlayfield.CENTER_X - width / 2,
|
||||
OriginalX = CatchPlayfield.CENTER_X - width / 2,
|
||||
Path = new SliderPath(PathType.Linear, new[]
|
||||
{
|
||||
Vector2.Zero,
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
StartTime = 1000,
|
||||
Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, new Vector2(0, -192) }),
|
||||
X = CatchPlayfield.WIDTH / 2
|
||||
OriginalX = CatchPlayfield.WIDTH / 2
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
beatmap.HitObjects.Add(new Fruit
|
||||
{
|
||||
X = (0.5f + i / 2048f * (i % 10 - 5)) * CatchPlayfield.WIDTH,
|
||||
OriginalX = (0.5f + i / 2048f * (i % 10 - 5)) * CatchPlayfield.WIDTH,
|
||||
StartTime = i * 100,
|
||||
NewCombo = i % 8 == 0
|
||||
});
|
||||
|
@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
JudgementResult result2 = null;
|
||||
AddStep("catch hyper fruit", () =>
|
||||
{
|
||||
attemptCatch(new Fruit { HyperDashTarget = new Fruit { X = 100 } }, out drawableObject1, out result1);
|
||||
attemptCatch(new Fruit { HyperDashTarget = new Fruit { OriginalX = 100 } }, out drawableObject1, out result1);
|
||||
});
|
||||
AddStep("catch normal fruit", () =>
|
||||
{
|
||||
@ -107,14 +107,14 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
var halfWidth = Catcher.CalculateCatchWidth(new BeatmapDifficulty { CircleSize = 0 }) / 2;
|
||||
AddStep("catch fruit", () =>
|
||||
{
|
||||
attemptCatch(new Fruit { X = -halfWidth + 1 });
|
||||
attemptCatch(new Fruit { X = halfWidth - 1 });
|
||||
attemptCatch(new Fruit { OriginalX = -halfWidth + 1 });
|
||||
attemptCatch(new Fruit { OriginalX = halfWidth - 1 });
|
||||
});
|
||||
checkPlate(2);
|
||||
AddStep("miss fruit", () =>
|
||||
{
|
||||
attemptCatch(new Fruit { X = -halfWidth - 1 });
|
||||
attemptCatch(new Fruit { X = halfWidth + 1 });
|
||||
attemptCatch(new Fruit { OriginalX = -halfWidth - 1 });
|
||||
attemptCatch(new Fruit { OriginalX = halfWidth + 1 });
|
||||
});
|
||||
checkPlate(2);
|
||||
}
|
||||
@ -122,7 +122,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
[Test]
|
||||
public void TestFruitChangesCatcherState()
|
||||
{
|
||||
AddStep("miss fruit", () => attemptCatch(new Fruit { X = 100 }));
|
||||
AddStep("miss fruit", () => attemptCatch(new Fruit { OriginalX = 100 }));
|
||||
checkState(CatcherAnimationState.Fail);
|
||||
AddStep("catch fruit", () => attemptCatch(new Fruit()));
|
||||
checkState(CatcherAnimationState.Idle);
|
||||
@ -135,7 +135,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
AddStep("catch hyper fruit", () => attemptCatch(new Fruit
|
||||
{
|
||||
HyperDashTarget = new Fruit { X = 100 }
|
||||
HyperDashTarget = new Fruit { OriginalX = 100 }
|
||||
}));
|
||||
checkHyperDash(true);
|
||||
AddStep("catch normal fruit", () => attemptCatch(new Fruit()));
|
||||
@ -147,10 +147,10 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
AddStep("catch hyper kiai fruit", () => attemptCatch(new TestKiaiFruit
|
||||
{
|
||||
HyperDashTarget = new Fruit { X = 100 }
|
||||
HyperDashTarget = new Fruit { OriginalX = 100 }
|
||||
}));
|
||||
AddStep("catch tiny droplet", () => attemptCatch(new TinyDroplet()));
|
||||
AddStep("miss tiny droplet", () => attemptCatch(new TinyDroplet { X = 100 }));
|
||||
AddStep("miss tiny droplet", () => attemptCatch(new TinyDroplet { OriginalX = 100 }));
|
||||
// catcher state and hyper dash state is preserved
|
||||
checkState(CatcherAnimationState.Kiai);
|
||||
checkHyperDash(true);
|
||||
@ -161,9 +161,9 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
AddStep("catch hyper kiai fruit", () => attemptCatch(new TestKiaiFruit
|
||||
{
|
||||
HyperDashTarget = new Fruit { X = 100 }
|
||||
HyperDashTarget = new Fruit { OriginalX = 100 }
|
||||
}));
|
||||
AddStep("miss banana", () => attemptCatch(new Banana { X = 100 }));
|
||||
AddStep("miss banana", () => attemptCatch(new Banana { OriginalX = 100 }));
|
||||
// catcher state is preserved but hyper dash state is reset
|
||||
checkState(CatcherAnimationState.Kiai);
|
||||
checkHyperDash(false);
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
AddStep("catch fruit", () => attemptCatch(new Fruit()));
|
||||
AddStep("catch fruit last in combo", () => attemptCatch(new Fruit { LastInCombo = true }));
|
||||
AddStep("catch kiai fruit", () => attemptCatch(new TestSceneCatcher.TestKiaiFruit()));
|
||||
AddStep("miss last in combo", () => attemptCatch(new Fruit { X = 100, LastInCombo = true }));
|
||||
AddStep("miss last in combo", () => attemptCatch(new Fruit { OriginalX = 100, LastInCombo = true }));
|
||||
}
|
||||
|
||||
private void attemptCatch(Fruit fruit)
|
||||
|
@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
var fruit = new Fruit
|
||||
{
|
||||
X = getXCoords(hit),
|
||||
OriginalX = getXCoords(hit),
|
||||
LastInCombo = i % 4 == 0,
|
||||
StartTime = playfieldTime + 800 + (200 * i)
|
||||
};
|
||||
@ -122,7 +122,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
|
||||
var juice = new JuiceStream
|
||||
{
|
||||
X = xCoords,
|
||||
OriginalX = xCoords,
|
||||
StartTime = playfieldTime + 1000,
|
||||
Path = new SliderPath(PathType.Linear, new[]
|
||||
{
|
||||
@ -145,7 +145,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
var banana = new Banana
|
||||
{
|
||||
X = getXCoords(hit),
|
||||
OriginalX = getXCoords(hit),
|
||||
LastInCombo = i % 4 == 0,
|
||||
StartTime = playfieldTime + 800 + (200 * i)
|
||||
};
|
||||
|
@ -70,20 +70,20 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
beatmap.ControlPointInfo.Add(0, new TimingControlPoint());
|
||||
|
||||
// Should produce a hyper-dash (edge case test)
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 1816, X = 56, NewCombo = true });
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 2008, X = 308, NewCombo = true });
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 1816, OriginalX = 56, NewCombo = true });
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 2008, OriginalX = 308, NewCombo = true });
|
||||
|
||||
double startTime = 3000;
|
||||
|
||||
const float left_x = 0.02f * CatchPlayfield.WIDTH;
|
||||
const float right_x = 0.98f * CatchPlayfield.WIDTH;
|
||||
|
||||
createObjects(() => new Fruit { X = left_x });
|
||||
createObjects(() => new Fruit { OriginalX = left_x });
|
||||
createObjects(() => new TestJuiceStream(right_x), 1);
|
||||
createObjects(() => new TestJuiceStream(left_x), 1);
|
||||
createObjects(() => new Fruit { X = right_x });
|
||||
createObjects(() => new Fruit { X = left_x });
|
||||
createObjects(() => new Fruit { X = right_x });
|
||||
createObjects(() => new Fruit { OriginalX = right_x });
|
||||
createObjects(() => new Fruit { OriginalX = left_x });
|
||||
createObjects(() => new Fruit { OriginalX = right_x });
|
||||
createObjects(() => new TestJuiceStream(left_x), 1);
|
||||
|
||||
beatmap.ControlPointInfo.Add(startTime, new TimingControlPoint
|
||||
@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
public TestJuiceStream(float x)
|
||||
{
|
||||
X = x;
|
||||
OriginalX = x;
|
||||
|
||||
Path = new SliderPath(new[]
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
new JuiceStream
|
||||
{
|
||||
X = CatchPlayfield.CENTER_X,
|
||||
OriginalX = CatchPlayfield.CENTER_X,
|
||||
Path = new SliderPath(PathType.Linear, new[]
|
||||
{
|
||||
Vector2.Zero,
|
||||
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
},
|
||||
new Banana
|
||||
{
|
||||
X = CatchPlayfield.CENTER_X,
|
||||
OriginalX = CatchPlayfield.CENTER_X,
|
||||
StartTime = 1000,
|
||||
NewCombo = true
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
Path = curveData.Path,
|
||||
NodeSamples = curveData.NodeSamples,
|
||||
RepeatCount = curveData.RepeatCount,
|
||||
X = positionData?.X ?? 0,
|
||||
OriginalX = positionData?.X ?? 0,
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
LegacyLastTickOffset = (obj as IHasLegacyLastTickOffset)?.LegacyLastTickOffset ?? 0
|
||||
@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
Samples = obj.Samples,
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
X = positionData?.X ?? 0
|
||||
OriginalX = positionData?.X ?? 0
|
||||
}.Yield();
|
||||
}
|
||||
}
|
||||
|
@ -33,14 +33,6 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
|
||||
float IHasXPosition.X => OriginalX;
|
||||
|
||||
/// <summary>
|
||||
/// An alias of <see cref="OriginalX"/> setter.
|
||||
/// </summary>
|
||||
public float X
|
||||
{
|
||||
set => OriginalX = value;
|
||||
}
|
||||
|
||||
public readonly Bindable<float> EffectiveXBindable = new Bindable<float>();
|
||||
|
||||
/// <summary>
|
||||
|
@ -75,7 +75,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
AddNested(new TinyDroplet
|
||||
{
|
||||
StartTime = t + lastEvent.Value.Time,
|
||||
X = OriginalX + Path.PositionAt(
|
||||
OriginalX = OriginalX + Path.PositionAt(
|
||||
lastEvent.Value.PathProgress + (t / sinceLastTick) * (e.PathProgress - lastEvent.Value.PathProgress)).X,
|
||||
});
|
||||
}
|
||||
@ -93,7 +93,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
Samples = dropletSamples,
|
||||
StartTime = e.Time,
|
||||
X = OriginalX + Path.PositionAt(e.PathProgress).X,
|
||||
OriginalX = OriginalX + Path.PositionAt(e.PathProgress).X,
|
||||
});
|
||||
break;
|
||||
|
||||
@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
Samples = this.GetNodeSamples(nodeIndex++),
|
||||
StartTime = e.Time,
|
||||
X = OriginalX + Path.PositionAt(e.PathProgress).X,
|
||||
OriginalX = OriginalX + Path.PositionAt(e.PathProgress).X,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user