public void AskForACard(List<Player> players, int myIndex, Deck stock) { if (stock.Count > 0) { if (cards.Count == 0) cards.Add(stock.Deal()); AskForACard(players, myIndex, stock, GetRandomValue()); } }
public void AskForACard(List<Player> players, int myIndex, Deck stock, Values value) { game.AddProgress(Name + " asks if anyone has a " + value.ToString()); int numberOfFoundCards = 0; for(int i=0; i<players.Count; ++i) { if(i != myIndex) { Deck foundCards = players[i].DoYouHaveAny(value); numberOfFoundCards += foundCards.Count; TakeCards(foundCards); } } if (numberOfFoundCards == 0 && stock.Count > 0) { TakeCard(stock.Deal()); game.AddProgress(Name + " had to draw from the stock."); } }