public EditorBeatmap(IBeatmap playableBeatmap, ISkin beatmapSkin = null) { PlayableBeatmap = playableBeatmap; if (beatmapSkin is Skin skin) { BeatmapSkin = new EditorBeatmapSkin(skin); } beatmapProcessor = playableBeatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateBeatmapProcessor(PlayableBeatmap); foreach (var obj in HitObjects) { trackStartTime(obj); } }
public EditorBeatmap(IBeatmap playableBeatmap, ISkin beatmapSkin = null, BeatmapInfo beatmapInfo = null) { PlayableBeatmap = playableBeatmap; // ensure we are not working with legacy control points. // if we leave the legacy points around they will be applied over any local changes on // ApplyDefaults calls. this should eventually be removed once the default logic is moved to the decoder/converter. if (PlayableBeatmap.ControlPointInfo is LegacyControlPointInfo) { var newControlPoints = new ControlPointInfo(); foreach (var controlPoint in PlayableBeatmap.ControlPointInfo.AllControlPoints) { switch (controlPoint) { case DifficultyControlPoint _: case SampleControlPoint _: // skip legacy types. continue; default: newControlPoints.Add(controlPoint.Time, controlPoint); break; } } playableBeatmap.ControlPointInfo = newControlPoints; } this.beatmapInfo = beatmapInfo ?? playableBeatmap.BeatmapInfo; if (beatmapSkin is Skin skin) { BeatmapSkin = new EditorBeatmapSkin(skin); } beatmapProcessor = playableBeatmap.BeatmapInfo.Ruleset.CreateInstance().CreateBeatmapProcessor(PlayableBeatmap); foreach (var obj in HitObjects) { trackStartTime(obj); } }