Exemplo n.º 1
0
        public Game(int numberOfPlayer, int numberOfHandCards)
        {
            _deckCreator = new DeckCreator();
            _deckCreator.FillCards();
            NumberOfPlayer    = numberOfPlayer;
            NumberOfHandCards = numberOfHandCards;

            Deal();
        }
Exemplo n.º 2
0
        private Card[] GetAllCardsFromDeck(IDeckCreator deckCreator)
        {
            var cards = new LinkedList<Card>();

            var deck = deckCreator.CreateDeck();

            while (!deck.IsEmpty)
            {
                cards.AddLast(deck.Deal());
            }

            return cards.ToArray();
        }
Exemplo n.º 3
0
 public EndlessCardsProvider(IDeckCreator deckCreator)
 {
     if (deckCreator == null) throw new ArgumentNullException(nameof(deckCreator));
     _deckCreator = deckCreator;
 }
Exemplo n.º 4
0
 public GameEngine([NotNull] IEntityContainer entityContainer, [NotNull] IDeckCreator deckCreator)
 {
     _EntityContainer = entityContainer ?? throw new ArgumentNullException(nameof(entityContainer));
     _DeckCreator     = deckCreator ?? throw new ArgumentNullException(nameof(deckCreator));
 }