Ejemplo n.º 1
0
 public void OnClick(PiecePoint point)
 {
     if (point != null && CurrentColor == MyColor)
     {
         point = MyColor == PieceColor.Red ? point : point.SymmetryPoint;
         if (selectPiece != null && SelectPoints.Contains(point))
         {
             var record = pieceBoard.GetChessRecord(selectPiece, point);
             MovePieceTest(record);
         }
         else
         {
             var piece = pieceBoard.GetPieceOnBoard(point);
             if (piece != null && piece.PieceInfo.PieceColor == CurrentColor)
             {
                 selecter.Select(piece);
                 PlaySound("capture");
                 return;
             }
             else if (selectPiece != null)
             {
                 PlaySound("uncapture");
             }
         }
     }
     else if (selectPiece != null)
     {
         PlaySound("uncapture");
     }
     selecter.UnSelect();
 }