Пример #1
0
        public void Update(GameTime gameTime)
        {
            while (TouchPanel.IsGestureAvailable)
            {
                var gesture = TouchPanel.ReadGesture();
                screenComponent.InvokeContainerGestureRead(gesture);

                if (gesture.GestureType == GestureType.Tap)
                {
                    screenComponent.InvokeContainerTap(gesture);
                }
            }

            screenComponent.Update(gameTime);
        }
Пример #2
0
        public async void Update(GameTime gameTime)
        {
            mapRenderer.Update(gameTime);

            while (TouchPanel.IsGestureAvailable)
            {
                var gesture = TouchPanel.ReadGesture();
                screenComponent.InvokeContainerGestureRead(gesture);

                if (gesture.GestureType == GestureType.FreeDrag)
                {
                    Pan(gesture);
                }
                if (gesture.GestureType == GestureType.Pinch)
                {
                    Zoom(gesture);
                }
                if (gesture.GestureType == GestureType.Tap)
                {
                    screenComponent.InvokeContainerTap(gesture);
                    await Tap(gesture);
                }
                if (gesture.GestureType == GestureType.Hold)
                {
                    screenComponent.InvokeContainerHeld(gesture);
                }
            }

            screenComponent.Update(gameTime);

            foreach (var drawable in entities.Drawables)
            {
                drawable.Update(gameTime);
            }

            endTurnButton.IsHighlighted = lockedInCharacter != null && !lockedInCharacter.HasRemainingMoves && !lockedInCharacter.HasRemainingPlayableCards;
        }