2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-01-08 02:34:37 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2019-02-21 10:04:31 +00:00
|
|
|
|
using osu.Framework.Bindables;
|
2017-08-07 09:03:44 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2020-05-25 09:26:28 +00:00
|
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-01-04 10:22:15 +00:00
|
|
|
|
namespace osu.Game.Rulesets.UI.Scrolling
|
2017-08-07 09:03:44 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2017-09-12 10:05:37 +00:00
|
|
|
|
/// A type of <see cref="Playfield"/> specialized towards scrolling <see cref="DrawableHitObject"/>s.
|
2017-08-07 09:03:44 +00:00
|
|
|
|
/// </summary>
|
2018-11-07 08:24:05 +00:00
|
|
|
|
public abstract partial class ScrollingPlayfield : Playfield
|
2017-08-07 09:03:44 +00:00
|
|
|
|
{
|
2018-11-06 06:46:36 +00:00
|
|
|
|
protected readonly IBindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
|
|
|
|
|
2020-11-26 05:07:40 +00:00
|
|
|
|
public new ScrollingHitObjectContainer HitObjectContainer => (ScrollingHitObjectContainer)base.HitObjectContainer;
|
|
|
|
|
|
2018-11-06 06:46:36 +00:00
|
|
|
|
[Resolved]
|
2022-05-12 07:13:31 +00:00
|
|
|
|
public IScrollingInfo ScrollingInfo { get; private set; } = null!;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-01-08 02:34:37 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
2020-05-21 04:33:02 +00:00
|
|
|
|
Direction.BindTo(ScrollingInfo.Direction);
|
2017-08-07 09:03:44 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-05-25 09:26:28 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Given a position in screen space, return the time within this column.
|
|
|
|
|
/// </summary>
|
2020-11-26 05:07:40 +00:00
|
|
|
|
public virtual double TimeAtScreenSpacePosition(Vector2 screenSpacePosition) => HitObjectContainer.TimeAtScreenSpacePosition(screenSpacePosition);
|
2020-05-25 09:26:28 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Given a time, return the screen space position within this column.
|
|
|
|
|
/// </summary>
|
2020-11-26 05:07:40 +00:00
|
|
|
|
public virtual Vector2 ScreenSpacePositionAtTime(double time) => HitObjectContainer.ScreenSpacePositionAtTime(time);
|
2020-05-25 09:26:28 +00:00
|
|
|
|
|
2022-10-04 06:17:11 +00:00
|
|
|
|
protected sealed override HitObjectContainer CreateHitObjectContainer() => CreateScrollingHitObjectContainer();
|
|
|
|
|
|
|
|
|
|
protected virtual ScrollingHitObjectContainer CreateScrollingHitObjectContainer() => new ScrollingHitObjectContainer();
|
2017-08-07 09:03:44 +00:00
|
|
|
|
}
|
2017-08-21 07:14:44 +00:00
|
|
|
|
}
|