1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 21:42:56 +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 };
}
public string Description => Type switch
public string Description
{
SplineType.Catmull => "Catmull",
SplineType.BSpline => Degree == null ? "Bezier" : "B-Spline",
SplineType.Linear => "Linear",
SplineType.PerfectCurve => "Perfect Curve",
_ => Type.ToString()
};
get
{
switch (Type)
{
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()
=> HashCode.Combine(Type, Degree);