예제 #1
0
파일: Player.cs 프로젝트: ppaier/HFCSharp
 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());
     }
 }
예제 #2
0
파일: Player.cs 프로젝트: ppaier/HFCSharp
        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.");
            }
        }