コード例 #1
0
        public Game(GameSettings gameSettings)
        {
            var deckDivisionStrategyFactory = new DealerFactory();
            var handOutStrategy             = deckDivisionStrategyFactory.Create(gameSettings.DealerStrategyType);


            var deck = new Deck(gameSettings.NumberOfJokersInDeck);

            _playerOne = new CardStack();
            _playerTwo = new CardStack();

            handOutStrategy.DealCards(deck, _playerOne, _playerTwo);

            _result = new GameResult();
        }
コード例 #2
0
        public void Select()
        {
            Console.Clear();

            var dealer  = DealerFactory.CreateDealer();
            var player1 = PlayerFactory.CreatePlayer(PlayerType.Human);
            var player2 = PlayerFactory.CreatePlayer(PlayerType.Computer);
            var player3 = PlayerFactory.CreatePlayer(PlayerType.Computer);
            var player4 = PlayerFactory.CreatePlayer(PlayerType.Computer);
            var players = new List <IPlayer>()
            {
                player1, player2, player3, player4
            };

            PokerGameFactory.CreateGame(players, dealer).Start();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Console.Title = "C# Poker Game v3";
            House.DisplayHouseRules();

            IDealer        dealer  = DealerFactory.CreateDealer();
            IPlayer        player1 = PlayerFactory.CreatePlayer(PlayerType.Computer);
            IPlayer        player2 = PlayerFactory.CreatePlayer(PlayerType.Human);
            List <IPlayer> players = new List <IPlayer>()
            {
                player1, player2
            };
            PokerGame pokerGame = PokerGameFactory.CreateGame(players, dealer);

            pokerGame.Start();

            Console.ReadLine();
        }
コード例 #4
0
 private IDealer GetTestDealer()
 {
     return(DealerFactory.CreateDealer());
 }