Exemple #1
0
        // 按下滑鼠
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            Piece piece = board.PlacePiece(e.X, e.Y, nextType);

            if (piece != null)
            {
                this.Controls.Add(piece);
                if (nextType == PieceType.Black)
                {
                    nextType = PieceType.White;
                }
                else if (nextType == PieceType.White)
                {
                    nextType = PieceType.Black;
                }
            }
        }