mirror of https://github.com/ppy/osu
Make Playfield.HitObjects internal to playfields.
Because not all playfields will be using this.
This commit is contained in:
parent
ab58acad81
commit
6445bea864
|
@ -187,17 +187,19 @@ public abstract class HitRenderer<TObject, TJudgement> : HitRenderer<TObject>
|
|||
|
||||
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result != HitResult.None);
|
||||
public override IEnumerable<HitObject> Objects => Beatmap.HitObjects;
|
||||
|
||||
protected override bool AllObjectsJudged => drawableObjects.All(h => h.Judgement.Result != HitResult.None);
|
||||
|
||||
/// <summary>
|
||||
/// The playfield.
|
||||
/// </summary>
|
||||
protected Playfield<TObject, TJudgement> Playfield;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
private readonly Container content;
|
||||
|
||||
public override IEnumerable<HitObject> Objects => Beatmap.HitObjects;
|
||||
private List<DrawableHitObject<TObject, TJudgement>> drawableObjects;
|
||||
|
||||
protected HitRenderer(WorkingBeatmap beatmap)
|
||||
: base(beatmap)
|
||||
|
@ -224,6 +226,8 @@ private void load()
|
|||
|
||||
private void loadObjects()
|
||||
{
|
||||
drawableObjects = new List<DrawableHitObject<TObject, TJudgement>>(Beatmap.HitObjects.Count);
|
||||
|
||||
foreach (TObject h in Beatmap.HitObjects)
|
||||
{
|
||||
var drawableObject = GetVisualRepresentation(h);
|
||||
|
@ -233,6 +237,7 @@ private void loadObjects()
|
|||
|
||||
drawableObject.OnJudgement += onJudgement;
|
||||
|
||||
drawableObjects.Add(drawableObject);
|
||||
Playfield.Add(drawableObject);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public abstract class Playfield<TObject, TJudgement> : Container
|
|||
/// <summary>
|
||||
/// The HitObjects contained in this Playfield.
|
||||
/// </summary>
|
||||
public HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects;
|
||||
protected HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects;
|
||||
|
||||
internal Container<Drawable> ScaledContent;
|
||||
|
||||
|
|
Loading…
Reference in New Issue