Exemple #1
0
        //Bắt đầu lại trò chơi mới
        public void PlayAgain()
        {
            OWin = new _5O_ChienThang();

            grdBanCo.Children.Clear(); //xóa hết tất cả các con cờ trên bàn cờ
            //   grdBanCo.Children.Add(ddau);//tạo hình vuong( tỏa tỏa)
            ResetBoard();              // tất cả các ô cờ chưa ai đánh hết
            this.DrawGomokuBoard();    //vẻ bàn cờ lên
            if (Option.WhoPlayWith == Player.Com)
            {
                if (end == Player.None)
                {
                    currPlayer = Player.Com;
                    DiNgauNhien();
                }
            }
            else
            {
                if (end == Player.None)
                {
                    if (currPlayer == Player.Human)
                    {
                        currPlayer = Player.Com;
                    }
                    else if (currPlayer == Player.Com)
                    {
                        currPlayer = Player.Human;
                    }
                }
            }
            end = Player.None;
        }
Exemple #2
0
 //Contructors
 public BanCo(MainWindow frm, Grid grd)
 {
     Option = new Option();
     OWin   = new _5O_ChienThang();
     row    = column = 12;
     board  = new Player[row, column];
     ResetBoard();
     eBoard     = new LuongGiaBanCo(this);
     currPlayer = Player.None;
     end        = Player.None;
     frmParent  = frm;
     grdBanCo   = grd;
     ddau       = new DanhDau();
     Createddau();
     grdBanCo.Children.Add(ddau);
     grdBanCo.MouseDown        += new System.Windows.Input.MouseButtonEventHandler(grdBanCo_MouseDown);
     worker.DoWork             += wait;
     worker.RunWorkerCompleted += danh;
 }
Exemple #3
0
 //Contructors
 public BanCo(MainWindow frm, Grid grd)
 {
     Option = new Option();
     OWin = new _5O_ChienThang();
     row = column = 12;
     board = new Player[row, column];
     ResetBoard();
     eBoard = new LuongGiaBanCo(this);
     currPlayer = Player.None;
     end = Player.None;
     frmParent = frm;
     grdBanCo = grd;
     ddau = new DanhDau();
     Createddau();
     grdBanCo.Children.Add(ddau);
     grdBanCo.MouseDown += new System.Windows.Input.MouseButtonEventHandler(grdBanCo_MouseDown);
     worker.DoWork += wait;
     worker.RunWorkerCompleted += danh;
 }
Exemple #4
0
        //Bắt đầu lại trò chơi mới
        public void PlayAgain()
        {
            OWin = new _5O_ChienThang();

            grdBanCo.Children.Clear();//xóa hết tất cả các con cờ trên bàn cờ
         //   grdBanCo.Children.Add(ddau);//tạo hình vuong( tỏa tỏa)
            ResetBoard();// tất cả các ô cờ chưa ai đánh hết
            this.DrawGomokuBoard();//vẻ bàn cờ lên
            if (Option.WhoPlayWith == Player.Com)
            {
                if (end == Player.None)
                {
                    currPlayer = Player.Com;
                    DiNgauNhien();
                }
            }
            else
            {
                if (end == Player.None)
                {
                    if (currPlayer == Player.Human)
                    {
                        currPlayer = Player.Com;
                    }
                    else if (currPlayer == Player.Com)
                    {
                        currPlayer = Player.Human;
                    }
                }
            }
            end = Player.None;
        }