Пример #1
0
        public override void Update(GameTime gameTime)
        {
            if (GameController.Instance.CurrentState != GameController.GameState.Running)
            {
                return;
            }

            //Check If We're Clicked
            MouseState state = Mouse.GetState();

            if (!_bounds.Intersects(new Rectangle(new Point(state.X, state.Y), new Point(1))))
            {
                return;
            }

            if (state.IsLeftButtonReleased())
            {
                //Reveal this tile
                //OnTileLeftClicked?.Invoke(Transform.GameObject);
                _tile.Reveal();
            }

            if (state.IsRightButtonReleased())
            {
                //Toggle flag on this tile
                //OnTileRightClicked?.Invoke(Transform.GameObject);
                _tile.ToggleFlag();
            }
        }