public override void Add(DrawableHitObject h) { if (!(h is InvadersDrawableHitObject note)) { throw new Exception("Unexpected hitobject type " + h.GetType().Name); } base.Add(note); }
public override void Add(DrawableHitObject h) { if (!(h is CytusDrawableHitObject note)) { throw new Exception("Unexpected hitobject type " + h.GetType().Name); } // everything is set in CytusDrawableHitObject..ctor base.Add(note); }
public override bool Remove(DrawableHitObject h) { switch (h) { case DrawableBarLine barLine: return(barLinePlayfield.Remove(barLine)); case DrawableTaikoHitObject _: return(base.Remove(h)); default: throw new ArgumentException($"Unsupported {nameof(DrawableHitObject)} type: {h.GetType()}"); } }
public override void Add(DrawableHitObject h) { switch (h) { case DrawableBarLine barLine: barLinePlayfield.Add(barLine); break; case DrawableTaikoHitObject _: base.Add(h); break; default: throw new ArgumentException($"Unsupported {nameof(DrawableHitObject)} type: {h.GetType()}"); } }
public override bool Remove(DrawableHitObject h) { switch (h) { case DrawableBarLine barLine: return(barLinePlayfield.Remove(barLine)); case DrawableTaikoHitObject _: h.OnNewResult -= OnNewResult; // todo: consider tidying of proxied content if required. return(base.Remove(h)); default: throw new ArgumentException($"Unsupported {nameof(DrawableHitObject)} type: {h.GetType()}"); } }
public override void Add(DrawableHitObject h) { switch (h) { case DrawableBarLine barLine: barLinePlayfield.Add(barLine); break; case DrawableTaikoHitObject taikoObject: h.OnNewResult += OnNewResult; topLevelHitContainer.Add(taikoObject.CreateProxiedContent()); base.Add(h); break; default: throw new ArgumentException($"Unsupported {nameof(DrawableHitObject)} type: {h.GetType()}"); } }