//Contructors public clsBanCo(MainWindow frm, Grid grd) { Option = new clsOption(); OWin = new cls5OWin(); row = column = 12; currPlayer = Player.None; end = Player.None; frmParent = frm; grdBanCo = grd; board = new Player[row, column]; ResetBoard(); eBoard = new clsLuongGiaBanCo(this); hv = new hinhvuong(); CreateHV(); grdBanCo.Children.Add(hv); grdBanCo.MouseDown += new System.Windows.Input.MouseButtonEventHandler(grdBanCo_MouseDown); worker.DoWork += wait; worker.RunWorkerCompleted +=maydanh; }
//Hàm lấy thông tin 5 ô Win hoặc Lose public static void OnWinOrLose() { Node node = new Node(); for (int i = 0; i < 5; i++) { node = OWin.GiaTri[i]; hinhvuong hv = new hinhvuong(); hv.Height = 40; hv.Width = 40; hv.Opacity = 100; hv.HorizontalAlignment = 0; hv.VerticalAlignment = 0; hv.Margin = new Thickness(node.Column * length - 2, node.Row * length - 3, 0, 0); grdBanCo.Children.Add(hv); } }