예제 #1
0
        //Hàm lấy thông tin 5 ô Win hoặc Lose
        //Hàm xem lại trò chơi vừa đấu


        private void DrawDataBoard(int rw, int cl, bool record, bool type)
        {
            if (type == true)
            {
                if (currPlayer == Player.Human)
                {
                    UserControl chess;
                    chess        = new ChessO_3();
                    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);
                }
                else if (currPlayer == Player.Com || currPlayer == Player.Onl)
                {
                    UserControl chess;
                    chess        = new ChessX_3();
                    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);
                }
            }
            else
            {
                Image Chess1 = new Image();
                if (currPlayer == Player.Human)
                {
                    Chess1.Source = new BitmapImage(new Uri("pack://application:,,,/Icon/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.Onl)
                {
                    Image Chess2 = new Image();
                    Chess2.Source = new BitmapImage(new Uri("pack://application:,,,/Icon/Chess/Chess_X_3.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);
                }
            }
        }
예제 #2
0
        //Hàm lấy thông tin 5 ô Win hoặc Lose
        //Hàm xem lại trò chơi vừa đấu
         
        
         private void DrawDataBoard(int rw, int cl,bool record,bool type)
         {
             if (type == true)
             {
                 if (currPlayer == Player.Human)
                 {
                     UserControl chess;
                     chess = new ChessO_3();
                     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);
                                         
                 }
                 else if (currPlayer == Player.Com || currPlayer == Player.Onl)
                 {
                     UserControl chess;
                     chess = new ChessX_3();
                     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);
                  }

             }
             else
             {
                 Image Chess1 = new Image();
                 if (currPlayer == Player.Human)
                 {
                     Chess1.Source = new BitmapImage(new Uri("pack://application:,,,/Icon/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.Onl)
                 {
                     Image Chess2 = new Image();
                     Chess2.Source = new BitmapImage(new Uri("pack://application:,,,/Icon/Chess/Chess_X_3.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);
                 }
             }
         }