コード例 #1
0
 public DealingService(bool startsFromLeft, List <Player> players)
 {
     _ps    = new PlayerService();
     _deck  = new TarotDeck(true);
     _rules = new DealingRules();
     _aside = new List <Card>();
     _round = new RoundService(startsFromLeft, players);
 }
コード例 #2
0
        private IEnumerable <Card> PickCardsForAside(TarotDeck tarotDeck, int asideCardsCount)
        {
            int nbRemainingCardsForAside = _rules.AsideMaxCards(NbPlayers()) - asideCardsCount;

            if (nbRemainingCardsForAside > 0)
            {
                Random rnd = new Random();
                int    rndNbCardsToSend = rnd.Next(1, DealingRules.NbCardsToDeal) + 1;

                return(tarotDeck.Pop(Math.Min(rndNbCardsToSend, nbRemainingCardsForAside)));
            }
            else
            {
                return(null);
            }
        }