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

Reorganise code slightly

This commit is contained in:
Dean Herbert 2021-08-09 15:57:18 +09:00
parent 3a741affa3
commit 30cda318f9

View File

@ -16,24 +16,24 @@ namespace osu.Game.Rulesets.Catch.Mods
public void ApplyToHitObject(HitObject hitObject) public void ApplyToHitObject(HitObject hitObject)
{ {
var catchObject = (CatchHitObject)hitObject; if (hitObject is BananaShower)
if (catchObject is BananaShower)
return; return;
var catchObject = (CatchHitObject)hitObject;
catchObject.OriginalX = CatchPlayfield.WIDTH - catchObject.OriginalX; catchObject.OriginalX = CatchPlayfield.WIDTH - catchObject.OriginalX;
foreach (var nested in catchObject.NestedHitObjects.Cast<CatchHitObject>()) foreach (var nested in catchObject.NestedHitObjects.Cast<CatchHitObject>())
nested.OriginalX = CatchPlayfield.WIDTH - nested.OriginalX; nested.OriginalX = CatchPlayfield.WIDTH - nested.OriginalX;
if (!(catchObject is JuiceStream juiceStream)) if (catchObject is JuiceStream juiceStream)
return; {
var controlPoints = juiceStream.Path.ControlPoints.Select(p => new PathControlPoint(p.Position.Value, p.Type.Value)).ToArray();
foreach (var point in controlPoints)
point.Position.Value = new Vector2(-point.Position.Value.X, point.Position.Value.Y);
var controlPoints = juiceStream.Path.ControlPoints.Select(p => new PathControlPoint(p.Position.Value, p.Type.Value)).ToArray(); juiceStream.Path = new SliderPath(controlPoints, juiceStream.Path.ExpectedDistance.Value);
foreach (var point in controlPoints) }
point.Position.Value = new Vector2(-point.Position.Value.X, point.Position.Value.Y);
juiceStream.Path = new SliderPath(controlPoints, juiceStream.Path.ExpectedDistance.Value);
} }
} }
} }