1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 16:47:24 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs

39 lines
1.4 KiB
C#
Raw Normal View History

2017-03-11 23:34:21 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Beatmaps;
2017-04-18 15:05:58 +08:00
using osu.Game.Rulesets.Mania.Objects;
2017-04-17 14:44:46 +08:00
using System;
using System.Collections.Generic;
using osu.Game.Beatmaps;
2017-04-18 15:05:58 +08:00
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using System.Linq;
2017-03-11 23:34:21 +08:00
2017-04-18 15:05:58 +08:00
namespace osu.Game.Rulesets.Mania.Beatmaps
2017-03-11 23:34:21 +08:00
{
public class ManiaBeatmapConverter : BeatmapConverter<ManiaHitObject>
2017-03-11 23:34:21 +08:00
{
2017-04-18 13:24:16 +08:00
protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };
2017-04-17 14:44:46 +08:00
protected override Beatmap<ManiaHitObject> ConvertBeatmap(Beatmap original)
2017-03-11 23:34:21 +08:00
{
// Todo: This should be cased when we get better conversion methods
var converter = new LegacyConverter(original);
return new Beatmap<ManiaHitObject>
{
BeatmapInfo = original.BeatmapInfo,
TimingInfo = original.TimingInfo,
HitObjects = original.HitObjects.SelectMany(converter.Convert).ToList()
};
2017-03-11 23:34:21 +08:00
}
protected override IEnumerable<ManiaHitObject> ConvertHitObject(HitObject original, Beatmap beatmap)
{
// Handled by the LegacyConvereter
yield return null;
}
2017-03-11 23:34:21 +08:00
}
}