Example #1
0
 private void DrawDataBoard(int rw, int cl) // Vẽ quân cờ
 {
     if (this._menu.curPlay == Player.Human)
     {
         UserControl chess;
         chess        = new ChessO();
         chess.Height = length;
         chess.Width  = length;
         chess.HorizontalAlignment = 0;
         chess.VerticalAlignment   = 0;
         chess.Margin = new Thickness(cl * length, rw * length, 0, 0);
         cvBanCo.Children.Add(chess);
         //Ghi lại cờ vừa đánh
         rec.Opacity = 100;
         rec.Margin  = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
     }
     else if (this._menu.curPlay == Player.Com)
     {
         UserControl chess;
         chess        = new ChessX();
         chess.Height = length;
         chess.Width  = length;
         chess.HorizontalAlignment = 0;
         chess.VerticalAlignment   = 0;
         chess.Margin = new Thickness(cl * length, rw * length, 0, 0);
         cvBanCo.Children.Add(chess);
         rec.Opacity = 100;
         rec.Margin  = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
     }
 }
Example #2
0
 private void DrawDataBoard(int rw, int cl) // Vẽ quân cờ
 {
     if (this._menu.curPlay == Player.Human)
     {
         UserControl chess;
         chess = new ChessO();
         chess.Height = length;
         chess.Width = length;
         chess.HorizontalAlignment = 0;
         chess.VerticalAlignment = 0;
         chess.Margin = new Thickness(cl * length, rw * length, 0, 0);
         cvBanCo.Children.Add(chess);
         //Ghi lại cờ vừa đánh
         rec.Opacity = 100;
         rec.Margin = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
     }
     else if (this._menu.curPlay == Player.Com)
     {
         UserControl chess;
         chess = new ChessX();
         chess.Height = length;
         chess.Width = length;
         chess.HorizontalAlignment = 0;
         chess.VerticalAlignment = 0;
         chess.Margin = new Thickness(cl * length, rw * length, 0, 0);
         cvBanCo.Children.Add(chess);
         rec.Opacity = 100;
         rec.Margin = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
     }
 }