예제 #1
0
        private void buildKeyboardInputQueue(Drawable current)
        {
            if (!current.HandleInput || !current.IsVisible || current.IsMaskedAway)
            {
                return;
            }

            if (current != this)
            {
                //stop processing at any nested InputManagers
                if ((current as InputManager)?.PassThrough == false)
                {
                    return;
                }

                keyboardInputQueue.Add(current);
            }

            IContainerEnumerable <Drawable> currentContainer = current as IContainerEnumerable <Drawable>;

            if (currentContainer != null)
            {
                foreach (Drawable d in currentContainer.AliveChildren)
                {
                    buildKeyboardInputQueue(d);
                }
            }
        }
예제 #2
0
        private void buildMouseInputQueue(InputState state, Drawable current)
        {
            if (!checkIsHoverable(current, state))
            {
                return;
            }

            if (current != this)
            {
                //stop processing at any nested InputManagers
                if ((current as InputManager)?.PassThrough == false)
                {
                    return;
                }

                mouseInputQueue.Add(current);
            }

            IContainerEnumerable <Drawable> currentContainer = current as IContainerEnumerable <Drawable>;

            if (currentContainer != null)
            {
                foreach (Drawable d in currentContainer.AliveChildren)
                {
                    buildMouseInputQueue(state, d);
                }
            }
        }
예제 #3
0
        public RigidBodySimulation(IContainerEnumerable <Drawable> container)
        {
            this.container = container;

            foreach (Drawable d in container.InternalChildren)
            {
                RigidBody body = getRigidBody(d);
                body.ApplyImpulse(new Vector2(RNG.NextSingle() - 0.5f, RNG.NextSingle() - 0.5f) * 100, body.Centre + new Vector2(RNG.NextSingle() - 0.5f, RNG.NextSingle() - 0.5f) * 100);
            }
        }