1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 05:43:33 +08:00
osu-lazer/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs

46 lines
1.5 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
2017-03-17 15:05:16 +08:00
using OpenTK.Graphics;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableTaikoHitObject : DrawableHitObject<TaikoHitObject, TaikoJudgementInfo>
{
2017-03-17 15:05:16 +08:00
/// <summary>
/// The colour used for various elements of this DrawableHitObject.
/// </summary>
public virtual Color4 AccentColour { get; }
public DrawableTaikoHitObject(TaikoHitObject hitObject)
: base(hitObject)
{
LifetimeStart = HitObject.StartTime - HitObject.PreEmpt;
LifetimeEnd = HitObject.StartTime + HitObject.PreEmpt;
}
protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoJudgementInfo();
protected override void UpdateState(ArmedState state)
{
}
2017-03-17 15:05:16 +08:00
/// <summary>
/// Sets the scroll position of the DrawableHitObject relative to the offset between
/// a time value and the HitObject's StartTime.
/// </summary>
/// <param name="time"></param>
protected void UpdateScrollPosition(double time)
{
MoveToX((float)((HitObject.StartTime - time) / HitObject.PreEmpt));
}
protected override void Update()
{
UpdateScrollPosition(Time.Current);
}
}
}