You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
882 B

using System;
using System.Collections.Generic;
using TheGameExtreme.model.card;
namespace TheGameExtreme.model.gameActions.classic
{
public class Piocher : GameAction
{
public Piocher(Piles ListOrderedStacks) : base(ListOrderedStacks)
{
}
protected bool checkRule()
{
return true;
}
public void pioche(List<Card> CurrentHand, Deck deck, Player player, int nbMaxCard)
{
int nbPickedCard = nbMaxCard - CurrentHand.Count;
for (int i = 0; i < nbPickedCard; i++)
{
if (deck.size() == 0)
{
return;
}
int random = new Random().Next(0, deck.size() - 1);
player.pioche(deck.getCard(random));
deck.removeAt(random);
}
}
}
}