1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 07:22:55 +08:00
osu-lazer/osu.Game/Modes/UI/Playfield.cs
2016-12-11 10:09:58 +01:00

48 lines
1.4 KiB
C#

//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Modes.Objects.Drawables;
using OpenTK;
namespace osu.Game.Modes.UI
{
public abstract class Playfield : Container
{
public HitObjectContainer HitObjects;
private Container<Drawable> content;
public virtual void Add(DrawableHitObject h) => HitObjects.Add(h);
public override bool Contains(Vector2 screenSpacePos) => true;
protected override Container<Drawable> Content => content;
public Playfield()
{
AddInternal(content = new ScaledContainer()
{
RelativeSizeAxes = Axes.Both,
});
Add(HitObjects = new HitObjectContainer
{
RelativeSizeAxes = Axes.Both,
});
}
public class ScaledContainer : Container
{
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
public override bool Contains(Vector2 screenSpacePos) => true;
}
public class HitObjectContainer : Container<DrawableHitObject>
{
public override bool Contains(Vector2 screenSpacePos) => true;
}
}
}