コード例 #1
0
        public override void Add(DrawableHitObject h)
        {
            if (!(h is InvadersDrawableHitObject note))
            {
                throw new Exception("Unexpected hitobject type " + h.GetType().Name);
            }

            base.Add(note);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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()}");
            }
        }
コード例 #4
0
        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()}");
            }
        }
コード例 #5
0
        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()}");
            }
        }
コード例 #6
0
        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()}");
            }
        }