mirror of
https://github.com/ppy/osu.git
synced 2024-12-21 13:22:57 +08:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|||
|
// See the LICENCE file in the repository root for full licence text.
|
|||
|
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Threading;
|
|||
|
using osu.Game.Beatmaps;
|
|||
|
using osu.Game.Rulesets.Objects;
|
|||
|
using osu.Game.Rulesets.Objects.Types;
|
|||
|
using osu.Game.Rulesets.Pippidon.Objects;
|
|||
|
using osuTK;
|
|||
|
|
|||
|
namespace osu.Game.Rulesets.Pippidon.Beatmaps
|
|||
|
{
|
|||
|
public class PippidonBeatmapConverter : BeatmapConverter<PippidonHitObject>
|
|||
|
{
|
|||
|
public PippidonBeatmapConverter(IBeatmap beatmap, Ruleset ruleset)
|
|||
|
: base(beatmap, ruleset)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasPosition);
|
|||
|
|
|||
|
protected override IEnumerable<PippidonHitObject> ConvertHitObject(HitObject original, IBeatmap beatmap, CancellationToken cancellationToken)
|
|||
|
{
|
|||
|
yield return new PippidonHitObject
|
|||
|
{
|
|||
|
Samples = original.Samples,
|
|||
|
StartTime = original.StartTime,
|
|||
|
Position = (original as IHasPosition)?.Position ?? Vector2.Zero,
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
}
|