Use pattern matching.

This commit is contained in:
Huo Yaoyuan
2019-11-12 18:16:51 +08:00
parent 7d7b9e36b2
commit e5e8e70704
13 changed files with 348 additions and 348 deletions

View File

@ -148,13 +148,9 @@ namespace osu.Game.Rulesets.UI.Scrolling
// Generate the timing points, making non-timing changes use the previous timing change and vice-versa
var timingChanges = allPoints.Select(c =>
{
var timingPoint = c as TimingControlPoint;
var difficultyPoint = c as DifficultyControlPoint;
if (timingPoint != null)
if (c is TimingControlPoint timingPoint)
lastTimingPoint = timingPoint;
if (difficultyPoint != null)
else if (c is DifficultyControlPoint difficultyPoint)
lastDifficultyPoint = difficultyPoint;
return new MultiplierControlPoint(c.Time)