public Muti_Server() { InitializeComponent(); DataClient dataClient = new DataClient(); dataClient.Show(); Control.CheckForIllegalCrossThreadCalls = false; boBai = new BoBai(); Connect(); }
private void label3_Click(object sender, EventArgs e) { label3.Visible = false; boBai = new BoBai(); com = new Player(); com.setLoaiNguoi(0); user = new Player(); user.setLoaiNguoi(1); Card card = new Card(); //card = boBai.getCard(); //com.addCard(card); card = new Card(); DrawCard(card, com.getLoaiNguoi(), 1); Thread.Sleep(100); card = boBai.getCard(); user.addCard(card); DrawCard(card, user.getLoaiNguoi(), user.getNumberCard(1)); Thread.Sleep(100); //card = boBai.getCard(); //com.addCard(card); card = new Card(); DrawCard(card, com.getLoaiNguoi(), 2); Thread.Sleep(100); card = boBai.getCard(); user.addCard(card); DrawCard(card, user.getLoaiNguoi(), user.getNumberCard(1)); Thread.Sleep(100); btnRut.Visible = true; label2.Text = (user.getSum()).ToString(); label2.Visible = true; if (Int32.Parse(label2.Text.Trim()) > 16) { btnDan.Visible = true; } }