osu/osu.Game/Beatmaps/Objects/HitObject.cs

40 lines
1.2 KiB
C#
Raw Normal View History

//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;
2016-11-02 09:08:08 +00:00
using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Objects
{
/// <summary>
/// A hitobject describes a point in a beatmap
/// </summary>
2016-09-26 06:07:29 +00:00
public abstract class HitObject
{
public double StartTime;
public virtual double EndTime => StartTime;
2016-11-02 09:08:08 +00:00
public bool NewCombo { get; set; }
public Color4 Colour = new Color4(17, 136, 170, 255);
public double Duration => EndTime - StartTime;
2016-09-02 09:31:32 +00:00
public HitSampleInfo Sample;
public static HitObject Parse(PlayMode mode, string val)
{
2016-10-13 02:41:11 +00:00
//TODO: move to modular HitObjectParser system rather than static parsing. (https://github.com/ppy/osu/pull/60/files#r83135780)
switch (mode)
{
case PlayMode.Osu:
return OsuBaseHit.Parse(val);
default:
return null;
}
}
}
}