Example #1
0
        public CardGameSessionManager(KeyInputSettings settings, ITextInterface textInterface, IPlayerCollectionFactory playerCollectionFactory, ICardGameFactory cardGameFactory)
        {
            Guard.AgainstNullDataContainer(settings, nameof(settings));
            Guard.AgainstNull(textInterface, nameof(textInterface));
            Guard.AgainstNull(playerCollectionFactory, nameof(playerCollectionFactory));
            Guard.AgainstNull(cardGameFactory, nameof(cardGameFactory));

            this.continueRoundKey          = settings.ContinueRoundKey;
            this.exitKey                   = settings.ExitKey;
            this.playerCollectionFactory   = playerCollectionFactory;
            this.cardGameFactory           = cardGameFactory;
            this.textInterface             = textInterface;
            this.textInterface.KeyPressed += TextInterface_KeyPressed;
        }
Example #2
0
        public CardGameFactory(CardGameCommands commands, IPlayerCollectionFactory playerCollectionFactory, IDeckFactory deckFactory, IScorerFactory scorerFactory, IVictoryCheckerFactory victoryCheckerFactory)
        {
            Guard.AgainstNullDataContainer(commands, nameof(commands));
            Guard.AgainstNull(playerCollectionFactory, nameof(playerCollectionFactory));
            Guard.AgainstNull(deckFactory, nameof(deckFactory));
            Guard.AgainstNull(scorerFactory, nameof(scorerFactory));
            Guard.AgainstNull(victoryCheckerFactory, nameof(victoryCheckerFactory));

            this.commands = commands;
            this.playerCollectionFactory = playerCollectionFactory;
            this.deckFactory             = deckFactory;
            this.victoryCheckerFactory   = victoryCheckerFactory;
            this.scorerFactory           = scorerFactory;
        }