コード例 #1
0
 private void RenderBothHands(Model.IHands hands)
 {
     Console.Write("Player: ");
     RenderHand(hands.PlayerCards, hands.PlayerScore);
     Console.Write("Dealer: ");
     RenderHand(hands.DealerCards, hands.DealerScore);
 }
コード例 #2
0
        public void PlayGame()
        {
            Game.DealNewHand();
            while (Game.IsGameOver() == false)
            {
                Model.IHands hands = Game.GetHands();
                GameView.RenderPlayersHands(hands);
                GameView.RenderGameActionChoices();
                switch (GameView.GetGameAction())
                {
                case View.GameAction.Hit:
                    Game.Hit();
                    break;

                case View.GameAction.Stay:
                    Game.DealerTakeCards();
                    Game.SetPlayerHasStayedTrue();
                    break;
                }
            }
            GameView.RenderResultOfGame(Game.GetHands());
        }
コード例 #3
0
 public void RenderResultOfGame(Model.IHands hands)
 {
     RenderBothHands(hands);
     Console.WriteLine((hands.PlayerScore > hands.DealerScore && hands.PlayerScore < 22) || hands.DealerScore > 21 ? "Player wins!!" : "Dealer wins!!");
 }
コード例 #4
0
 public void RenderPlayersHands(Model.IHands hands)
 {
     RenderBothHands(hands);
 }