コード例 #1
0
ファイル: Program.cs プロジェクト: TheBamby/minesweeper
        /// <summary>
        /// Passes a left|right mouseclick to the field class and rerenders the game.
        /// </summary>
        /// <param name="button">Pressed mouse button.</param>
        /// <param name="x_tile">Clicked tile x coors.</param>
        /// <param name="y_tile">Clicked tile y coors.</param>
        public void MouseClick(MouseButtons button, uint x_tile, uint y_tile)
        {
            switch (button)
            {
            case MouseButtons.Left:
                gameField.LeftClickTile(x_tile, y_tile);
                break;

            case MouseButtons.Right:
                gameField.RightClickTile(x_tile, y_tile);
                break;
            }
            gameForm.Invalidate();
        }