Exemple #1
0
        public DrawCardsCommandHandler(KeyInputSettings settings, ITextInterface textInterface, ICardCollectionFactory cardCollectionFactory) : base(textInterface)
        {
            Guard.AgainstNullDataContainer(settings, nameof(settings));
            Guard.AgainstNull(textInterface, nameof(textInterface));
            Guard.AgainstNull(cardCollectionFactory, nameof(cardCollectionFactory));

            this.drawCardKey           = settings.DrawCardKey;
            this.cardCollectionFactory = cardCollectionFactory;
        }
Exemple #2
0
        public DefaultCardDealerLogic(ICardCollectionFactory cardCollectionFactory,
                                      ICardTypeDescriptor cardTypeDescriptor, ICardObjectFactory cardObjectFactory)
        {
            Check.NotNull(cardCollectionFactory, "cardCollectionFactory");
            Check.NotNull(cardTypeDescriptor, "cardTypeDescriptor");
            Check.NotNull(cardObjectFactory, "cardObjectFactory");

            m_cardCollectionFactory = cardCollectionFactory;
            m_cardTypeDescriptor    = cardTypeDescriptor;
            m_cardObjectFactory     = cardObjectFactory;
        }
Exemple #3
0
        public DefaultSnapGameType(ICardDealerLogic cardDealer, ICardCollectionFactory cardCollectionFactory)
        {
            Check.NotNull(cardDealer, "cardDealer");
            Check.NotNull(cardCollectionFactory, "cardCollectionFactory");

            var decksOfPlayers = cardDealer.DealCards(PlayerCount);

            Players = new List <ICardGamePlayer>()
            {
                new Player("Ray", decksOfPlayers[0], cardCollectionFactory.CreateCardCollection()),
                new Player("Lucy", decksOfPlayers[1], cardCollectionFactory.CreateCardCollection()),
                new Player("Steve", decksOfPlayers[2], cardCollectionFactory.CreateCardCollection()),
                new Player("Player 1", decksOfPlayers[3], cardCollectionFactory.CreateCardCollection()),
            };

            DealingLogic = cardDealer;
        }