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

            grdBanCo.Children.Clear();

            ResetBoard();
            this.DrawGomokuBoard();
            if (Option.WhoPlayWith == Player.Com)
            {
                if (end == Player.None)
                {
                    currPlayer = Player.Com;
                }
                if (currPlayer == Player.Com && Option.WhoPlayWith == 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 TuyChon();
            OWin       = new cls5OWin();
            row        = column = 12;
            currPlayer = Player.None;
            end        = Player.None;
            frmParent  = frm;
            grdBanCo   = grd;
            board      = new Player[row, column];
            ResetBoard();
            eBoard = new LuongGia(this);


            grdBanCo.MouseDown        += new System.Windows.Input.MouseButtonEventHandler(grdBanCo_MouseDown);
            worker.DoWork             += wait;
            worker.RunWorkerCompleted += maydanh;
        }
Exemple #3
0
        //Contructors
        public BanCo(MainWindow frm, Grid grd)
        {
            Option = new TuyChon();
            OWin = new cls5OWin();
            row = column = 12;
            currPlayer = Player.None;
            end = Player.None;
            frmParent = frm;
            grdBanCo = grd;
            board = new Player[row, column];
            ResetBoard();
            eBoard = new LuongGia(this);

          
            grdBanCo.MouseDown += new System.Windows.Input.MouseButtonEventHandler(grdBanCo_MouseDown);
            worker.DoWork += wait;
            worker.RunWorkerCompleted +=maydanh;
        }
        //Bắt đầu lại trò chơi mới
        public void PlayAgain()
        {
            OWin = new cls5OWin();

            grdBanCo.Children.Clear();
            grdBanCo.Children.Add(hv);
            ResetBoard();
            this.DrawGomokuBoard();
            if (Option.WhoPlayWith == Player.Com)
            {
                if (end == Player.None)
                {
                    currPlayer = Player.Com;

                }
                if (currPlayer == Player.Com && Option.WhoPlayWith == 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;
        }