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