Пример #1
0
        private OtherInputState GetOtherState(OtherInput pOtherInput, OtherState pOtherState)
        {
            OtherInputState state = OtherInputState.Released;

            switch (pOtherInput)
            {
                case OtherInput.LeftStickFlickDown:

                    state = pOtherState.LeftStickFlickDown;

                    break;
                case OtherInput.LeftStickFlickLeft:

                    state = pOtherState.LeftStickFlickLeft;

                    break;
                case OtherInput.LeftStickFlickRight:

                    state = pOtherState.LeftStickFlickRight;

                    break;
                case OtherInput.LeftStickFlickUp:

                    state = pOtherState.LeftStickFlickUp;

                    break;
                case OtherInput.RightStickFlickDown:

                    state = pOtherState.RightStickFlickDown;

                    break;
                case OtherInput.RightStickFlickLeft:

                    state = pOtherState.RightStickFlickLeft;

                    break;
                case OtherInput.RightStickFlickRight:

                    state = pOtherState.RightStickFlickRight;

                    break;
                case OtherInput.RightStickFlickUp:

                    state = pOtherState.RightStickFlickUp;

                    break;
            }

            return state;
        }
Пример #2
0
        private static InputState GetOtherState(OtherInput pOtherInput)
        {
            InputState state = new InputState();

            state.Down = false;
            state.Pressed = false;
            state.Released = false;

            if (sOtherInputState.ContainsKey(pOtherInput))
            {
                state.Down |= sOtherInputState[pOtherInput].Down;
                state.Pressed |= sOtherInputState[pOtherInput].Pressed;
                state.Released |= sOtherInputState[pOtherInput].Released;
            }

            return state;
        }
Пример #3
0
        public void Listen(OtherInput pOtherInput)
        {
            if (!sOtherInputState.ContainsKey(pOtherInput))
            {

                InputState state = new InputState();

                OtherInputState otherState = GetOtherState(pOtherInput, sOtherState);

                state.Down = (otherState == OtherInputState.Pressed);
                state.Pressed = false;
                state.Released = false;

                sOtherInputState.Add(pOtherInput, state);
            }
        }
Пример #4
0
        public void Alias(string pIndex, OtherInput pOtherInput)
        {
            if (!sOtherAlias.ContainsKey(pIndex))
                sOtherAlias.Add(pIndex, new List<OtherInput>());

            sOtherAlias[pIndex].Add(pOtherInput);

            if (!sOtherInputState.ContainsKey(pOtherInput))
            {

                InputState state = new InputState();

                OtherInputState otherState = GetOtherState(pOtherInput, sOtherState);

                state.Down = (otherState == OtherInputState.Pressed);
                state.Pressed = false;
                state.Released = false;

                sOtherInputState.Add(pOtherInput, state);
            }
        }
Пример #5
0
        public static bool Up(OtherInput pOtherInput)
        {
            bool ret;

            if (GetOtherState(pOtherInput).Down)
                ret = false;
            else
                ret = true;

            return ret;
        }
Пример #6
0
        public static bool Released(OtherInput pOtherInput)
        {
            bool ret;

            if (GetOtherState(pOtherInput).Released)
                ret = true;
            else
                ret = false;

            return ret;
        }