1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-24 13:22:55 +08:00
osu-lazer/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.7 KiB
C#
Raw Normal View History

// 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 17:19:50 +08:00
using osu.Framework.Allocation;
2019-02-21 18:04:31 +08:00
using osu.Framework.Bindables;
2017-08-07 17:03:44 +08:00
using osu.Game.Rulesets.Objects.Drawables;
using osuTK;
2018-04-13 17:19:50 +08:00
2018-01-04 18:22:15 +08:00
namespace osu.Game.Rulesets.UI.Scrolling
2017-08-07 17:03:44 +08:00
{
/// <summary>
2017-09-12 18:05:37 +08:00
/// A type of <see cref="Playfield"/> specialized towards scrolling <see cref="DrawableHitObject"/>s.
2017-08-07 17:03:44 +08:00
/// </summary>
public abstract partial class ScrollingPlayfield : Playfield
2017-08-07 17:03:44 +08:00
{
2018-11-06 14:46:36 +08:00
protected readonly IBindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
public new ScrollingHitObjectContainer HitObjectContainer => (ScrollingHitObjectContainer)base.HitObjectContainer;
2018-11-06 14:46:36 +08:00
[Resolved]
public IScrollingInfo ScrollingInfo { get; private set; } = null!;
2018-04-13 17:19:50 +08:00
[BackgroundDependencyLoader]
private void load()
{
Direction.BindTo(ScrollingInfo.Direction);
2017-08-07 17:03:44 +08:00
}
2018-04-13 17:19:50 +08:00
/// <summary>
/// Given a position in screen space, return the time within this column.
/// </summary>
public virtual double TimeAtScreenSpacePosition(Vector2 screenSpacePosition) => HitObjectContainer.TimeAtScreenSpacePosition(screenSpacePosition);
/// <summary>
/// Given a time, return the screen space position within this column.
/// </summary>
public virtual Vector2 ScreenSpacePositionAtTime(double time) => HitObjectContainer.ScreenSpacePositionAtTime(time);
protected sealed override HitObjectContainer CreateHitObjectContainer() => CreateScrollingHitObjectContainer();
protected virtual ScrollingHitObjectContainer CreateScrollingHitObjectContainer() => new ScrollingHitObjectContainer();
2017-08-07 17:03:44 +08:00
}
}