public GameBoard(BattleGround battleGround) { this.battleGround = battleGround; InitializeComponent(); /*for (int i = 0; i < battleGround.player1.hand.Count; i++) * { * //cards.Add(account.decklist[i].name); * cards.Add(new Button()); * int j = cards.Count - 1; * cards[j].Text = "cost: "+ battleGround.player1.hand[i].cost+"\nattack:"+ battleGround.player1.hand[i].attack + "\nhp:" + battleGround.player1.hand[i].hp; * cards[j].Location = new Point(10 + i * 100, 30); * cards[j].Size = new Size(80, 50); * cards[j].Tag = battleGround.player1.hand[i]; * cards[j].MouseDown += new System.Windows.Forms.MouseEventHandler(CardButton_MouseDown); * cards[j].MouseUp += new System.Windows.Forms.MouseEventHandler(CardButton_MouseUp); * Controls.Add(cards[j]); * } * for (int i = 0; i < battleGround.player2.hand.Count; i++) * { * //cards.Add(account.decklist[i].name); * cards.Add(new Button()); * int j = cards.Count - 1; * cards[j].Text = "cost: " + battleGround.player2.hand[i].cost + "\nattack:" + battleGround.player2.hand[i].attack + "\nhp:" + battleGround.player2.hand[i].hp; * cards[j].Location = new Point(10 + i * 100, 500); * cards[j].Size = new Size(80, 50); * cards[j].Tag = battleGround.player2.hand[i]; * cards[j].MouseDown += new System.Windows.Forms.MouseEventHandler(CardButton_MouseDown); * cards[j].MouseUp += new System.Windows.Forms.MouseEventHandler(CardButton_MouseUp); * Controls.Add(cards[j]); * }*/ Fresh(); }
private void buttonStart_Click(object sender, EventArgs e) { if (playerDeck_choose[1] == -1 || playerDeck_choose[2] == -1) { return; } var player1 = account.decklist[playerDeck_choose[1]]; var player2 = account.decklist[playerDeck_choose[2]]; var battleGround = new BattleGround(player1, player2); var newform = new GameBoard(battleGround); this.Hide(); newform.ShowDialog(); //Application.ExitThread(); this.Show(); }