Esempio n. 1
0
        public static InputSubject GetKeyEnterSubject()
        {
            InputMan pMan = InputMan.GetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pSubjectKeyEnter);
        }
Esempio n. 2
0
        public static InputSubject GetSpaceSubject()
        {
            InputMan pMan = InputMan.GetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pSubjectSpace);
        }
Esempio n. 3
0
        public static InputSubject GetArrowLeftSubject()
        {
            InputMan pMan = InputMan.GetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pSubjectArrowLeft);
        }
Esempio n. 4
0
        public static void Reset()
        {
            InputMan pMan = InputMan.GetInstance();

            Debug.Assert(pMan != null);

            pMan.pSubjectArrowLeft  = new InputSubject();
            pMan.pSubjectArrowRight = new InputSubject();
            pMan.pSubjectSpace      = new InputSubject();
            pMan.pSubjectT          = new InputSubject();
            pMan.pSubjectKey1       = new InputSubject();
            pMan.pSubjectKey2       = new InputSubject();
            pMan.pSubjectKeyEnter   = new InputSubject();
        }
Esempio n. 5
0
        public static void Update()
        {
            InputMan pMan = InputMan.GetInstance();

            Debug.Assert(pMan != null);

            // left key
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_LEFT) == true)
            {
                pMan.pSubjectArrowLeft.notify();
            }

            // right key
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_ARROW_RIGHT) == true)
            {
                pMan.pSubjectArrowRight.notify();
            }

            // T key
            bool currTKey = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_T);

            if (currTKey == true && pMan.prevTKey == false)
            {
                pMan.pSubjectT.notify();
            }

            pMan.prevTKey = currTKey;

            // space key
            bool currSpaceKey = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_SPACE);

            if (currSpaceKey == true && pMan.prevSpaceKey == false)
            {
                pMan.pSubjectSpace.notify();
            }

            pMan.prevSpaceKey = currSpaceKey;

            // 1 key
            bool curr1Key = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_1);

            if (curr1Key == true && pMan.prev1Key == false)
            {
                pMan.pSubjectKey1.notify();
            }

            pMan.prev1Key = curr1Key;

            // 2 key
            bool curr2Key = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_2);

            if (curr2Key == true && pMan.prev2Key == false)
            {
                pMan.pSubjectKey2.notify();
            }

            pMan.prev2Key = curr2Key;

            // enter key
            bool currEnterKey = Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_B);

            if (currEnterKey == true && pMan.prevEnterKey == false)
            {
                pMan.pSubjectKeyEnter.notify();
            }

            pMan.prevEnterKey = currEnterKey;
        }