예제 #1
0
        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);
            }
        }
예제 #2
0
파일: EditorBeatmap.cs 프로젝트: Wieku/osu
        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);
            }
        }