1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 11:42:55 +08:00

Change switchexpr to standard switch statement

This commit is contained in:
Bartłomiej Dach 2023-11-20 12:25:44 +09:00
parent 577cb9994c
commit 25c1a90047
No known key found for this signature in database

View File

@ -46,14 +46,29 @@ namespace osu.Game.Rulesets.Objects.Types
return new PathType { Type = SplineType.BSpline, Degree = degree }; return new PathType { Type = SplineType.BSpline, Degree = degree };
} }
public string Description => Type switch public string Description
{ {
SplineType.Catmull => "Catmull", get
SplineType.BSpline => Degree == null ? "Bezier" : "B-Spline", {
SplineType.Linear => "Linear", switch (Type)
SplineType.PerfectCurve => "Perfect Curve", {
_ => Type.ToString() case SplineType.Catmull:
}; return "Catmull";
case SplineType.BSpline:
return Degree == null ? "Bezier" : "B-Spline";
case SplineType.Linear:
return "Linear";
case SplineType.PerfectCurve:
return "Perfect Curve";
default:
return Type.ToString();
}
}
}
public override int GetHashCode() public override int GetHashCode()
=> HashCode.Combine(Type, Degree); => HashCode.Combine(Type, Degree);