Пример #1
0
        public bool PlayGame(view.Console a_view, model.GameFacade a_game)
        {
            a_view.PresentInstructions();
            a_view.DisplayHands(a_game.GetDealerHand(), a_game.GetDealerScore(), a_game.GetPlayerHand(), a_game.GetPlayerScore());
            if (a_game.IsGameOver())
            {
                a_view.DisplayWinner(a_game.IsPlayerWinner());
            }

            view.Console.Event e;

            e = a_view.GetEvent();
            if (e == view.Console.Event.Quit)
            {
                return false;
            }
            if (e == view.Console.Event.Start)
            {
                a_game.StartNewRound();

            }
            if (e == view.Console.Event.Hit)
            {
                a_game.Hit();
            }
            if (e == view.Console.Event.Stand)
            {
                a_game.Stand();
            }

            return true;
        }
Пример #2
0
        public bool PlayGame(view.Console a_view, model.Dealer a_dealer, model.Player a_player)
        {
            a_view.PresentInstructions();
            a_view.DisplayHands(a_dealer.GetHand(), a_player.GetHand());
            view.Console.Event e;

            e = a_view.GetEvent();
            if (e == view.Console.Event.Quit)
            {
                return false;
            }
            if (e == view.Console.Event.Start)
            {
                a_dealer.StartNewRound(a_player);

            }

            return true;
        }