public void PlayerDrawsCard(int position) { ICard card = cardsOnTable[position]; if ((card.GetCardColor() == CardColor.All)) { if (actionPoints == 2) { players[activePlayer].GiveCard(cardsOnTable[position]); cardsOnTable[position] = cards.DrawCard(); actionPoints = 0; } else if (actionPoints == 1) { MessageBox.Show("Už nemůžeš lízat lokomotivu", "Lokomotiva nelze líznout", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Už nemůžeš lízat kartu", "Karta nelze líznout", MessageBoxButtons.OK, MessageBoxIcon.Information); } } if ((card.GetCardColor() != CardColor.All)) { if (actionPoints > 0) { players[activePlayer].GiveCard(cardsOnTable[position]); if (cards.GetCount() > 0) { cardsOnTable[position] = cards.DrawCard(); } else { cards.Shuffle(discarded); if (cards.GetCount() > 0) { cardsOnTable[position] = cards.DrawCard(); } } actionPoints--; } else { MessageBox.Show("Už nemůžeš lízat kartu", "Karta nelze líznout", MessageBoxButtons.OK, MessageBoxIcon.Information); } } gv.UpdateTable(); }
public TasksForm(CardPile tasks, Game game) { InitializeComponent(); this.tasks = tasks; this.index = 0; this.number = tasks.GetCount(); this.game = game; }