1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 13:07:25 +08:00
osu-lazer/osu.Game/Beatmaps/Objects/HitObject.cs
Drew DeVault 9b4bc3e36d Implement most of the legacy beatmap decoder
Missing timing points, events, and hit object decoders remain to be
written
2016-10-13 12:17:03 +09:00

34 lines
921 B
C#

//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps.Objects.Osu;
using osu.Game.Beatmaps.Samples;
using osu.Game.GameModes.Play;
namespace osu.Game.Beatmaps.Objects
{
/// <summary>
/// A hitobject describes a point in a beatmap
/// </summary>
public abstract class HitObject
{
public double StartTime;
public double? EndTime;
public double Duration => (EndTime ?? StartTime) - StartTime;
public HitSampleInfo Sample;
public static HitObject Parse(PlayMode mode, string val)
{
switch (mode)
{
case PlayMode.Osu:
return OsuBaseHit.Parse(val);
default:
return null;
}
}
}
}