mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Subtract out playfield/hitrenderer/drawablehitobject changes.
This commit is contained in:
parent
da4be2f9d6
commit
3118dad52b
@ -12,7 +12,6 @@ using Container = osu.Framework.Graphics.Containers.Container;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Audio;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
@ -25,11 +24,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
|
||||
public TJudgement Judgement;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this hit object has been judged.
|
||||
/// </summary>
|
||||
public virtual bool Judged => (Judgement?.Result ?? HitResult.None) != HitResult.None;
|
||||
|
||||
protected abstract TJudgement CreateJudgement();
|
||||
|
||||
protected abstract void UpdateState(ArmedState state);
|
||||
@ -55,10 +49,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
internal DrawableHitObject()
|
||||
{
|
||||
}
|
||||
|
||||
protected List<SampleChannel> Samples = new List<SampleChannel>();
|
||||
|
||||
protected void PlaySamples()
|
||||
@ -94,12 +84,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
/// <summary>
|
||||
/// The colour used for various elements of this DrawableHitObject.
|
||||
/// </summary>
|
||||
public virtual Color4 AccentColour { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether this hit object and all of its nested hit objects have been judged.
|
||||
/// </summary>
|
||||
public sealed override bool Judged => base.Judged && NestedHitObjects.All(h => h.Judged);
|
||||
public Color4 AccentColour { get; protected set; }
|
||||
|
||||
protected DrawableHitObject(TObject hitObject)
|
||||
{
|
||||
@ -183,11 +168,15 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<DrawableHitObject<TObject, TJudgement>> nestedHitObjects = new List<DrawableHitObject<TObject, TJudgement>>();
|
||||
private List<DrawableHitObject<TObject, TJudgement>> nestedHitObjects;
|
||||
|
||||
protected IEnumerable<DrawableHitObject<TObject, TJudgement>> NestedHitObjects => nestedHitObjects;
|
||||
|
||||
protected void AddNested(DrawableHitObject<TObject, TJudgement> h)
|
||||
{
|
||||
if (nestedHitObjects == null)
|
||||
nestedHitObjects = new List<DrawableHitObject<TObject, TJudgement>>();
|
||||
|
||||
h.OnJudgement += d => OnJudgement?.Invoke(d);
|
||||
nestedHitObjects.Add(h);
|
||||
}
|
||||
|
@ -187,19 +187,17 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
|
||||
|
||||
public override IEnumerable<HitObject> Objects => Beatmap.HitObjects;
|
||||
|
||||
protected override bool AllObjectsJudged => drawableObjects.All(o => o.Judged);
|
||||
protected override Container<Drawable> Content => content;
|
||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.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;
|
||||
|
||||
private readonly List<DrawableHitObject<TObject, TJudgement>> drawableObjects = new List<DrawableHitObject<TObject, TJudgement>>();
|
||||
public override IEnumerable<HitObject> Objects => Beatmap.HitObjects;
|
||||
|
||||
protected HitRenderer(WorkingBeatmap beatmap)
|
||||
: base(beatmap)
|
||||
@ -226,8 +224,6 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
private void loadObjects()
|
||||
{
|
||||
drawableObjects.Clear();
|
||||
|
||||
foreach (TObject h in Beatmap.HitObjects)
|
||||
{
|
||||
var drawableObject = GetVisualRepresentation(h);
|
||||
@ -237,7 +233,6 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
drawableObject.OnJudgement += onJudgement;
|
||||
|
||||
drawableObjects.Add(drawableObject);
|
||||
Playfield.Add(drawableObject);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <summary>
|
||||
/// The HitObjects contained in this Playfield.
|
||||
/// </summary>
|
||||
protected HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects;
|
||||
public HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects;
|
||||
|
||||
internal Container<Drawable> ScaledContent;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user