Exemplo n.º 1
0
 public static void DrawDataBoard(int rw, int cl, bool record, bool type)
 {
     if (type == true)
     {
         if (currPlayer == Player.Human)
         {
             UserControl co;
             co        = new ChessO_1();
             co.Height = length;
             co.Width  = length;
             co.HorizontalAlignment = 0;
             co.VerticalAlignment   = 0;
             co.Margin = new Thickness(cl * length, rw * length, 0, 0);
             grdBanCo.Children.Add(co);
             //Ghi lại cờ vừa đánh
             ddau.Opacity = 100;
             ddau.Margin  = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
         }
         else if (currPlayer == Player.Com || currPlayer == Player.Online)
         {
             UserControl co;
             co        = new ChessX_1();
             co.Height = length;
             co.Width  = length;
             co.HorizontalAlignment = 0;
             co.VerticalAlignment   = 0;
             co.Margin = new Thickness(cl * length, rw * length, 0, 0);
             grdBanCo.Children.Add(co);
             ddau.Opacity = 100;
             ddau.Margin  = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
         }
     }
     else
     {
         Image co1 = new Image();
         if (currPlayer == Player.Human)
         {
             co1.Source = new BitmapImage(new Uri("pack://application:,,,/Image/Chess/ok-icon (1).png"));
             co1.Width  = co1.Height = length;
             co1.HorizontalAlignment = 0;
             co1.VerticalAlignment   = 0;
             co1.Margin  = new Thickness(cl * length, rw * length, 0, 0);
             co1.Opacity = 100;
             grdBanCo.Children.Add(co1);
         }
         else if (currPlayer == Player.Com || currPlayer == Player.Online)
         {
             Image co2 = new Image();
             co2.Source = new BitmapImage(new Uri("pack://application:,,,/Image/Chess/Cute-Ball-Stop-icon.png"));
             co2.Width  = co2.Height = length;
             co2.HorizontalAlignment = 0;
             co2.VerticalAlignment   = 0;
             co2.Margin  = new Thickness(cl * length, rw * length, 0, 0);
             co2.Opacity = 100;
             grdBanCo.Children.Add(co2);
         }
     }
 }
Exemplo n.º 2
0
        public static void DrawDataBoard(int rw, int cl, bool record, bool type)
        {
            if (type == true)
            {
                if (currPlayer == Player.Human)
                {
                    UserControl co;
                    co = new ChessO_1();
                    co.Height = length;
                    co.Width = length;
                    co.HorizontalAlignment = 0;
                    co.VerticalAlignment = 0;
                    co.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    grdBanCo.Children.Add(co);
                    //Ghi lại cờ vừa đánh
                    ddau.Opacity = 100;
                    ddau.Margin = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
                }
                else if (currPlayer == Player.Com || currPlayer == Player.Online)
                {
                    UserControl co;
                    co = new ChessX_1();
                    co.Height = length;
                    co.Width = length;
                    co.HorizontalAlignment = 0;
                    co.VerticalAlignment = 0;
                    co.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    grdBanCo.Children.Add(co);
                    ddau.Opacity = 100;
                    ddau.Margin = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
                }

            }
            else
            {
                Image co1 = new Image();
                if (currPlayer == Player.Human)
                {
                    co1.Source = new BitmapImage(new Uri("pack://application:,,,/Image/Chess/ok-icon (1).png"));
                    co1.Width = co1.Height = length;
                    co1.HorizontalAlignment = 0;
                    co1.VerticalAlignment = 0;
                    co1.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    co1.Opacity = 100;
                    grdBanCo.Children.Add(co1);
                }
                else if (currPlayer == Player.Com || currPlayer == Player.Online)
                {
                    Image co2 = new Image();
                    co2.Source = new BitmapImage(new Uri("pack://application:,,,/Image/Chess/Cute-Ball-Stop-icon.png"));
                    co2.Width = co2.Height = length;
                    co2.HorizontalAlignment = 0;
                    co2.VerticalAlignment = 0;
                    co2.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    co2.Opacity = 100;
                    grdBanCo.Children.Add(co2);
                }
            }
        }
Exemplo n.º 3
0
        public static void DrawDataBoard(int rw, int cl, bool record, bool type)
        {
            if (type == true)
            {
                if (currPlayer == Player.Human)
                {
                    UserControl chess;
                    chess = new ChessO_1();
                    chess.Height = length;
                    chess.Width = length;
                    chess.HorizontalAlignment = 0;
                    chess.VerticalAlignment = 0;
                    chess.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    grdBanCo.Children.Add(chess);
                    //Ghi lại cờ vừa đánh
                    hv.Opacity = 100;
                    hv.Margin = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
                }
                else if (currPlayer == Player.Com || currPlayer == Player.Online)
                {
                    UserControl chess;
                    chess = new ChessX_1();
                    chess.Height = length;
                    chess.Width = length;
                    chess.HorizontalAlignment = 0;
                    chess.VerticalAlignment = 0;
                    chess.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    grdBanCo.Children.Add(chess);
                    hv.Opacity = 100;
                    hv.Margin = new Thickness(cl * length - 10, rw * length - 10, 0, 0);
                }

            }
            else
            {
                Image Chess1 = new Image();
                if (currPlayer == Player.Human)
                {
                    Chess1.Source = new BitmapImage(new Uri("pack://application:,,,/Image/Chess/Chess_0_1.png"));
                    Chess1.Width = Chess1.Height = length;
                    Chess1.HorizontalAlignment = 0;
                    Chess1.VerticalAlignment = 0;
                    Chess1.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    Chess1.Opacity = 100;
                    grdBanCo.Children.Add(Chess1);
                }
                else if (currPlayer == Player.Com || currPlayer == Player.Online )
                {
                    Image Chess2 = new Image();
                    Chess2.Source = new BitmapImage(new Uri("pack://application:,,,/Image/Chess/Chess_X_1.png"));
                    Chess2.Width = Chess2.Height = length;
                    Chess2.HorizontalAlignment = 0;
                    Chess2.VerticalAlignment = 0;
                    Chess2.Margin = new Thickness(cl * length, rw * length, 0, 0);
                    Chess2.Opacity = 100;
                    grdBanCo.Children.Add(Chess2);
                }
            }
        }