public static InputSubject GetArrowLeftSubject()
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pSubjectArrowLeft);
        }
        public static InputSubject GetKey_Q_Subject()
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pSubjectKey_Q);
        }
Beispiel #3
0
        public static InputSubject GetMouseRightKeySubject()
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pSubjectRightMouseKey);
        }
        public static void SetActive(InputMan pInputMan)
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pInputMan != null);
            InputMan.pInstance = pInputMan;
        }
Beispiel #5
0
        //public static InputObserver MoveRight()
        //{
        //    InputMan pMan = InputMan.privGetInstance();
        //    Debug.Assert(pMan != null);

        //    return pMan.pRight;
        //}

        //public static InputObserver MoveLeft()
        //{
        //    InputMan pMan = InputMan.privGetInstance();
        //    Debug.Assert(pMan != null);

        //    return pMan.pLeft;
        //}

        //public static InputObserver Shoot()
        //{
        //    InputMan pMan = InputMan.privGetInstance();
        //    Debug.Assert(pMan != null);

        //    return pMan.pSpace;
        //}

        //public static InputObserver ToggleBox()
        //{
        //    InputMan pMan = InputMan.privGetInstance();
        //    Debug.Assert(pMan != null);

        //    return pMan.pBoxKey;
        //}
        //public static InputObserver OnePlayer()
        //{
        //    InputMan pMan = InputMan.privGetInstance();
        //    Debug.Assert(pMan != null);

        //    return pMan.pOnePlayer;
        //}
        //public static InputObserver TwoPlayer()
        //{
        //    InputMan pMan = InputMan.privGetInstance();
        //    Debug.Assert(pMan != null);

        //    return pMan.pTwoPlayer;
        //}
        public static void Update()
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            // SpaceKey: (with key history) -----------------------------------------------------------
            bool spaceKeyCurr = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_SPACE);

            if (spaceKeyCurr == true && pMan.spaceIsPressed == false)
            {
                pMan.pSpace.Notify();
            }

            pMan.spaceIsPressed = spaceKeyCurr;
            // LeftKey: (no history) -----------------------------------------------------------
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_LEFT) == true)
            {
                pMan.pLeft.Notify();
            }

            // RightKey: (no history) -----------------------------------------------------------
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_RIGHT) == true)
            {
                pMan.pRight.Notify();
            }

            bool p1 = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_1);

            if (p1 == true && pMan.oneIsPressed == false)
            {
                pMan.pOnePlayer.Notify();
            }

            pMan.oneIsPressed = p1;

            bool p2 = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_2);

            if (p2 == true && pMan.twoIsPressed == false)
            {
                pMan.pTwoPlayer.Notify();
            }

            pMan.twoIsPressed = p2;

            bool pBox = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_T);

            if (pBox == true && pMan.boxIsPressed == false)
            {
                pMan.pBoxKey.Notify();
            }

            pMan.boxIsPressed = pBox;
        }
        public static void Update()
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            bool spaceKeyCurr = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_SPACE);

            if (spaceKeyCurr == true && pMan.privSpaceKeyPrev == false)
            {
                pMan.pSubjectSpace.Notify();
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_LEFT) == true)
            {
                pMan.pSubjectArrowLeft.Notify();
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_RIGHT) == true)
            {
                pMan.pSubjectArrowRight.Notify();
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_B) == true)
            {
                pMan.pSubjectKey_B.Notify();
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_1) == true)
            {
                pMan.pSubjectKey_1.Notify();
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_2) == true)
            {
                pMan.pSubjectKey_2.Notify();
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_Q) == true)
            {
                pMan.pSubjectKey_Q.Notify();
            }

            pMan.privSpaceKeyPrev = spaceKeyCurr;
        }
Beispiel #7
0
        public static InputSubject GetPeriodSubject()
        {
            InputMan pMan = InputMan.privGetInstance();

            return(pMan.pSubjectPeriod);
        }
Beispiel #8
0
        public static InputSubject GetCommaSubject()
        {
            InputMan pMan = InputMan.privGetInstance();

            return(pMan.pSubjectComma);
        }
Beispiel #9
0
        public static void Update()
        {
            InputMan pMan = InputMan.privGetInstance();

            Debug.Assert(pMan != null);

            float xCurs = -1;
            float yCurs = -1;

            Azul.Input.GetCursor(ref xCurs, ref yCurs);

            // LeftKey: (no history) -----------------------------------------------------------
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_LEFT) == true)
            {
                pMan.pSubjectArrowLeft.Notify();
            }

            // RightKey: (no history) -----------------------------------------------------------
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_RIGHT) == true)
            {
                pMan.pSubjectArrowRight.Notify();
            }

            // AKey: (no history) -----------------------------------------------------------
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_A) == true)
            {
                pMan.pSubjectAKey.Notify();
            }

            // DKey: (no history) -----------------------------------------------------------
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_D) == true)
            {
                pMan.pSubjectDKey.Notify();
            }

            // SKey: (with key history) -----------------------------------------------------------
            bool sKeyCurr = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_S);

            if (sKeyCurr == true && pMan.privSKeyPrev == false)
            {
                pMan.pSubjectSKey.Notify();
            }
            pMan.privSKeyPrev = sKeyCurr;

            // PeriodKey: (with key history) -----------------------------------------------------------
            bool periodKeycurr = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_PERIOD);

            if (periodKeycurr == true && pMan.privPeriodKeyPrev == false)
            {
                pMan.pSubjectPeriod.Notify();
            }
            pMan.privPeriodKeyPrev = periodKeycurr;

            // CommaKey: (with key history) -----------------------------------------------------------
            bool commaKeycurr = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_COMMA);

            if (commaKeycurr == true && pMan.privCommaKeyPrev == false)
            {
                pMan.pSubjectComma.Notify();
            }
            pMan.privCommaKeyPrev = commaKeycurr;

            // SpaceKey: (with key history) -----------------------------------------------------------
            bool spaceKeyCurr = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_SPACE);

            if (spaceKeyCurr == true && pMan.privSpaceKeyPrev == false)
            {
                pMan.pSubjectSpace.Notify();
            }
            pMan.privSpaceKeyPrev = spaceKeyCurr;

            // MouseLeft: (with key history) -----------------------------------------------------------
            bool mouseLeftKeyCurr = Azul.Input.GetKeyState(Azul.AZUL_MOUSE.BUTTON_LEFT);

            if (mouseLeftKeyCurr == true && pMan.privMouseLeftKeyPrev == false)
            {
                pMan.pSubjectLeftMouseKey.Notify(xCurs, yCurs);
            }
            pMan.privMouseLeftKeyPrev = mouseLeftKeyCurr;

            // MouseRight: (with key history) -----------------------------------------------------------
            bool mouseRightKeyCurr = Azul.Input.GetKeyState(Azul.AZUL_MOUSE.BUTTON_RIGHT);

            if (mouseRightKeyCurr == true && pMan.privMouseRightKeyPrev == false)
            {
                pMan.pSubjectRightMouseKey.Notify(xCurs, yCurs);
            }
            pMan.privMouseRightKeyPrev = mouseRightKeyCurr;

            pMan.pSubjectCursor.Notify(xCurs, yCurs);
        }