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