Exemplo n.º 1
0
        public GamePadWrapper RequestGamepad()
        {
            if (numberOfGamepadsInUse >= maxNumberOfGamePads)
            {
                return(null);
            }

            int id;

            for (id = 0; id < maxNumberOfGamePads; id++)
            {
                if (gamePads[id] == null)
                {
                    break;
                }
            }

            numberOfGamepadsInUse++;

            gamePads[id]             = new GamePadWrapper(id);
            gamePadStateUpdaters[id] = gamePads[id].UpdateState;
            gamePadStateUpdaters[id](0f);

            return(gamePads[id]);
        }
Exemplo n.º 2
0
        protected override void Update(GameTime gameTime)
        {
            KeyboardWrapper.UpdateState();
            GamePadWrapper.UpdateAllGamePads();
            MouseUtility.Update();
            FrameCounter.IncrementFrameCount();

            myStateStack.ResolveQueuedThings();

            if (myStateStack.GetCurrentState() == null)
            {
                Exit();
                return;
            }

            myStateStack.Update();

            base.Update(gameTime);
            NetPostMaster.Master.ResolveMessages();
        }
Exemplo n.º 3
0
 protected override void LoadContent()
 {
     mySpriteBatch = new SpriteBatch(GraphicsDevice);
     GamePadWrapper.UpdateAllGamePads();
 }
Exemplo n.º 4
0
 public Button(GamePadWrapper gamePadWrapper)
 {
     this.gamePadWrapper = gamePadWrapper;
 }