Reduce implementation overhead in actually positioning hitobjects and making them scroll.

This commit is contained in:
smoogipooo
2017-08-07 16:02:38 +09:00
parent 068dfcb19a
commit a3efca9c35
8 changed files with 32 additions and 27 deletions

View File

@ -3,6 +3,7 @@
using System;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Types;
@ -17,6 +18,19 @@ namespace osu.Game.Rulesets.Objects.Drawables
{
public BindableDouble LifetimeOffset { get; } = new BindableDouble();
Axes IScrollingHitObject.ScrollingAxes
{
set
{
RelativePositionAxes = value;
if ((value & Axes.X) > 0)
X = (float)HitObject.StartTime;
if ((value & Axes.Y) > 0)
Y = (float)HitObject.StartTime;
}
}
protected DrawableScrollingHitObject(TObject hitObject)
: base(hitObject)
{

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// <summary>
/// An interface that exposes properties required for scrolling hit objects to be properly displayed.
/// </summary>
public interface IScrollingHitObject : IDrawable
internal interface IScrollingHitObject : IDrawable
{
/// <summary>
/// Time offset before the hit object start time at which this <see cref="IScrollingHitObject"/> becomes visible and the time offset
@ -21,5 +21,11 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// </para>
/// </summary>
BindableDouble LifetimeOffset { get; }
/// <summary>
/// Axes which this <see cref="IScrollingHitObject"/> will scroll through.
/// This is set by the container which this scrolls through.
/// </summary>
Axes ScrollingAxes { set; }
}
}