public void InitRedChess() { ChessItemBing cib; cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.red; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 0; cib.GridY = 6; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.red; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 2; cib.GridY = 6; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.red; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 4; cib.GridY = 6; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.red; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 6; cib.GridY = 6; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.red; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 8; cib.GridY = 6; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); ChessItemJu cij; cij = new ChessItemJu(); cij.type = IChess.Enums.ChessType.red; cij.Width = 50; cij.Height = 50; cij.Text = "车"; cij.GridX = 0; cij.GridY = 9; cij.InitItem(); cij.Click += new EventHandler(cib_Click); this.Controls.Add(cij); cij = new ChessItemJu(); cij.type = IChess.Enums.ChessType.red; cij.Width = 50; cij.Height = 50; cij.Text = "车"; cij.GridX = 8; cij.GridY = 9; cij.InitItem(); cij.Click += new EventHandler(cib_Click); this.Controls.Add(cij); ChessItemXiang cix; cix = new ChessItemXiang(); cix.type = IChess.Enums.ChessType.red; cix.Width = 50; cix.Height = 50; cix.Text = "Ïó"; cix.GridX = 2; cix.GridY = 9; cix.InitItem(); cix.Click += new EventHandler(cib_Click); this.Controls.Add(cix); cix = new ChessItemXiang(); cix.type = IChess.Enums.ChessType.red; cix.Width = 50; cix.Height = 50; cix.Text = "Ïó"; cix.GridX = 6; cix.GridY = 9; cix.InitItem(); cix.Click += new EventHandler(cib_Click); this.Controls.Add(cix); ChessItemPao cip; cip = new ChessItemPao(); cip.type = IChess.Enums.ChessType.red; cip.Width = 50; cip.Height = 50; cip.Text = "砲"; cip.GridX = 1; cip.GridY = 7; cip.InitItem(); cip.Click += new EventHandler(cib_Click); this.Controls.Add(cip); cip = new ChessItemPao(); cip.type = IChess.Enums.ChessType.red; cip.Width = 50; cip.Height = 50; cip.Text = "砲"; cip.GridX = 7; cip.GridY = 7; cip.InitItem(); cip.Click += new EventHandler(cib_Click); this.Controls.Add(cip); ChessItemMa cim; cim = new ChessItemMa(); cim.type = IChess.Enums.ChessType.red; cim.Width = 50; cim.Height = 50; cim.Text = "碼"; cim.GridX = 1; cim.GridY = 9; cim.InitItem(); cim.Click += new EventHandler(cib_Click); this.Controls.Add(cim); cim = new ChessItemMa(); cim.type = IChess.Enums.ChessType.red; cim.Width = 50; cim.Height = 50; cim.Text = "碼"; cim.GridX = 7; cim.GridY = 9; cim.InitItem(); cim.Click += new EventHandler(cib_Click); this.Controls.Add(cim); ChessItemShi cishi; cishi = new ChessItemShi(); cishi.type = IChess.Enums.ChessType.red; cishi.Width = 50; cishi.Height = 50; cishi.Text = "兵"; cishi.GridX = 3; cishi.GridY = 9; cishi.InitItem(); cishi.Click += new EventHandler(cib_Click); this.Controls.Add(cishi); cishi = new ChessItemShi(); cishi.type = IChess.Enums.ChessType.red; cishi.Width = 50; cishi.Height = 50; cishi.Text = "兵"; cishi.GridX = 5; cishi.GridY = 9; cishi.InitItem(); cishi.Click += new EventHandler(cib_Click); this.Controls.Add(cishi); ChessItemShuai cishuai; cishuai = new ChessItemShuai(); cishuai.type = IChess.Enums.ChessType.red; cishuai.Width = 50; cishuai.Height = 50; cishuai.Text = "˧"; cishuai.GridX = 4; cishuai.GridY = 9; cishuai.InitItem(); cishuai.Click += new EventHandler(cib_Click); cishuai.WinEvent += new ChessItem.ChessItemShuai.WinEventHandle(cishuai_WinEvent); this.Controls.Add(cishuai); }
public void InitBlueChess() { // PictureBox pb = new PictureBox(); // pb.Location = new Point(100,114); // pb.Image = bmp; // this.Controls.Add(pb); ChessItemBing cib; cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.blue; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 0; cib.GridY = 3; cib.InitItem(); // cib.BackgroundImage = bmp; cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.blue; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 2; cib.GridY = 3; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.blue; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 4; cib.GridY = 3; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.blue; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 6; cib.GridY = 3; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); cib = new ChessItemBing(); cib.type = IChess.Enums.ChessType.blue; cib.Width = 50; cib.Height = 50; cib.Text = "兵"; cib.GridX = 8; cib.GridY = 3; cib.InitItem(); cib.Click += new EventHandler(cib_Click); this.Controls.Add(cib); ChessItemJu cij; cij = new ChessItemJu(); cij.type = IChess.Enums.ChessType.blue; cij.Width = 50; cij.Height = 50; cij.Text = "车"; cij.GridX = 0; cij.GridY = 0; cij.InitItem(); cij.Click += new EventHandler(cib_Click); this.Controls.Add(cij); cij = new ChessItemJu(); cij.type = IChess.Enums.ChessType.blue; cij.Width = 50; cij.Height = 50; cij.Text = "车"; cij.GridX = 8; cij.GridY = 0; cij.InitItem(); cij.Click += new EventHandler(cib_Click); this.Controls.Add(cij); ChessItemXiang cix; cix = new ChessItemXiang(); cix.type = IChess.Enums.ChessType.blue; cix.Width = 50; cix.Height = 50; cix.Text = "Ïà"; cix.GridX = 2; cix.GridY = 0; cix.InitItem(); cix.Click += new EventHandler(cib_Click); this.Controls.Add(cix); cix = new ChessItemXiang(); cix.type = IChess.Enums.ChessType.blue; cix.Width = 50; cix.Height = 50; cix.Text = "Ïà"; cix.GridX = 6; cix.GridY = 0; cix.InitItem(); cix.Click += new EventHandler(cib_Click); this.Controls.Add(cix); ChessItemPao cip; cip = new ChessItemPao(); cip.type = IChess.Enums.ChessType.blue; cip.Width = 50; cip.Height = 50; cip.Text = "砲"; cip.GridX = 1; cip.GridY = 2; cip.InitItem(); cip.Click += new EventHandler(cib_Click); this.Controls.Add(cip); cip = new ChessItemPao(); cip.type = IChess.Enums.ChessType.blue; cip.Width = 50; cip.Height = 50; cip.Text = "砲"; cip.GridX = 7; cip.GridY = 2; cip.InitItem(); cip.Click += new EventHandler(cib_Click); this.Controls.Add(cip); ChessItemMa cim; cim = new ChessItemMa(); cim.type = IChess.Enums.ChessType.blue; cim.Width = 50; cim.Height = 50; cim.Text = "碼"; cim.GridX = 1; cim.GridY = 0; cim.InitItem(); cim.Click += new EventHandler(cib_Click); this.Controls.Add(cim); cim = new ChessItemMa(); cim.type = IChess.Enums.ChessType.blue; cim.Width = 50; cim.Height = 50; cim.Text = "碼"; cim.GridX = 7; cim.GridY = 0; cim.InitItem(); cim.Click += new EventHandler(cib_Click); this.Controls.Add(cim); ChessItemShi cishi; cishi = new ChessItemShi(); cishi.type = IChess.Enums.ChessType.blue; cishi.Width = 50; cishi.Height = 50; cishi.Text = "兵"; cishi.GridX = 3; cishi.GridY = 0; cishi.InitItem(); cishi.Click += new EventHandler(cib_Click); this.Controls.Add(cishi); cishi = new ChessItemShi(); cishi.type = IChess.Enums.ChessType.blue; cishi.Width = 50; cishi.Height = 50; cishi.Text = "兵"; cishi.GridX = 5; cishi.GridY = 0; cishi.InitItem(); cishi.Click += new EventHandler(cib_Click); this.Controls.Add(cishi); ChessItemShuai cishuai; cishuai = new ChessItemShuai(); cishuai.type = IChess.Enums.ChessType.blue; cishuai.Width = 50; cishuai.Height = 50; cishuai.Text = "½«"; cishuai.GridX = 4; cishuai.GridY = 0; cishuai.InitItem(); cishuai.Click += new EventHandler(cib_Click); cishuai.WinEvent += new ChessItem.ChessItemShuai.WinEventHandle(cishuai_WinEvent); this.Controls.Add(cishuai); }