public void displayDeck() { grpBxDeck.Controls.Clear(); for (int i = 0; i < durakDeck.remainingCard(); i++) { cbxCards = new CardBoxComponent(); cbxCards.Card = durakDeck.GetCard(i); cbxCards.Left = 5 + (i * 10); cbxCards.Top = 12; cbxCards.Height = 60; cbxCards.Width = 40; cbxCards.FaceUp = FaceStatus.Up; grpBxDeck.Controls.Add(cbxCards); } Label lblDeckCounter = new Label(); lblDeckCounter.Top = 200; lblDeckCounter.Left = 50; lblDeckCounter.Text = durakDeck.remainingCard().ToString(); grpBxDeck.Controls.Add(lblDeckCounter); // For debugging Debug.WriteLine("Deck started"); for (int i = 0; i < durakDeck.remainingCard(); i++) { Debug.WriteLine(durakDeck.GetCard(i)); } Debug.WriteLine("Deck ended"); }
private void Card_Click(object sender, EventArgs e) { cbxCards = (CardBoxComponent)sender; Card humanDefendCard = cbxCards.Card; if (humanAttackTurn() == false) { if (humanDefend(humanDefendCard)) { btnAction.Text = "..."; btnAction.Enabled = false; playingField.clearPlayingField(); txtMoves.Text = "Ai Discarded cards"; isHumanTurn = true; isHumanAttacking = true; } whoWin(); displayPlayingCard(); displayAiHand(); displayHumanHand(); displayDeck(); refillCards(); } }
public void displayAiHand() { grpBxAi.Controls.Clear(); for (int i = 0; i < playerHandAi.totalCards(); i++) { cbxCards = new CardBoxComponent(); cbxCards.Card = durakAi.GetCard(i); cbxCards.Left = 5 + (i * 20); cbxCards.Top = 12; cbxCards.Height = 60; cbxCards.Width = 40; cbxCards.FaceUp = FaceStatus.Up; grpBxAi.Controls.Add(cbxCards); } }
public void displayPlayingCard() { grpBxPlayingField.Controls.Clear(); for (int i = 0; i < playingField.totalCards(); i++) { cbxCards = new CardBoxComponent(); cbxCards.Card = playingField.GetCard(i); cbxCards.Left = 5 + (i * 45); cbxCards.Top = 20; cbxCards.Height = 60; cbxCards.Width = 40; cbxCards.FaceUp = FaceStatus.Up; grpBxPlayingField.Controls.Add(cbxCards); } }
public void displayHumanHand() { grpBxHuman.Controls.Clear(); for (int i = 0; i < playerHandHuman.totalCards(); i++) { cbxCards = new CardBoxComponent(); cbxCards.Card = durakHuman.GetCard(i); cbxCards.Left = 5 + (i * 20); cbxCards.Top = 12; cbxCards.Height = 60; cbxCards.Width = 40; cbxCards.FaceUp = FaceStatus.Up; grpBxHuman.Controls.Add(cbxCards); cbxCards.cardClicked += new EventHandler(Card_Click); } }