1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 22:22:54 +08:00
osu-lazer/osu.Game.Modes.Taiko/Objects/TaikoConverter.cs

40 lines
1.1 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
2016-11-14 17:54:24 +08:00
using osu.Game.Modes.Objects;
using osu.Game.Modes.Osu.Objects;
2017-02-09 13:56:39 +08:00
using osu.Game.Beatmaps;
2016-11-14 17:54:24 +08:00
namespace osu.Game.Modes.Taiko.Objects
{
class TaikoConverter : HitObjectConverter<TaikoBaseHit>
{
2017-02-09 13:56:39 +08:00
public override List<TaikoBaseHit> Convert(Beatmap beatmap)
{
List<TaikoBaseHit> output = new List<TaikoBaseHit>();
2017-02-09 13:56:39 +08:00
foreach (HitObject i in beatmap.HitObjects)
{
TaikoBaseHit h = i as TaikoBaseHit;
if (h == null)
{
OsuHitObject o = i as OsuHitObject;
2016-10-13 20:53:42 +08:00
if (o == null) throw new HitObjectConvertException(@"Taiko", i);
h = new TaikoBaseHit
{
StartTime = o.StartTime,
};
}
output.Add(h);
}
return output;
}
}
}