// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Rulesets.Objects.Drawables; using osuTK; namespace osu.Game.Rulesets.UI.Scrolling { /// /// A type of specialized towards scrolling s. /// public abstract class ScrollingPlayfield : Playfield { protected readonly IBindable Direction = new Bindable(); [Resolved] protected IScrollingInfo ScrollingInfo { get; private set; } [BackgroundDependencyLoader] private void load() { Direction.BindTo(ScrollingInfo.Direction); } /// /// Given a position in screen space, return the time within this column. /// public virtual double TimeAtScreenSpacePosition(Vector2 screenSpacePosition) => ((ScrollingHitObjectContainer)HitObjectContainer).TimeAtScreenSpace(screenSpacePosition); /// /// Given a time, return the screen space position within this column. /// public virtual Vector2 ScreenSpacePositionAtTime(double time) => ((ScrollingHitObjectContainer)HitObjectContainer).ScreenSpacePositionAtTime(time); protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(); } }