public void PlayGame(model.DiceGame a_game)
        {
            a_game.AddSubscriber(this);
            m_view.DisplayInstruction();

            while (m_view.WantsToPlay())
            {
                m_view.DisplayInstruction();

                m_view.DisplayResult(a_game.Play());
            }
        }
예제 #2
0
        public void PlayGame(model.DiceGame a_game, view.Console a_view)
        {
            a_view.DisplayInstructions();

            while (a_view.WantsToPlay())
            {
                a_view.DisplayInstructions();

                a_view.DisplayResult(a_game.Play(), a_game.GetDice1Value(), a_game.GetDice2Value());

            }
        }
예제 #3
0
        public void Play(model.DiceGame a_game)
        {
            String message = "Welcome to the cool Dice Game. Press any Key to play, or q to Quit";

            System.Console.WriteLine(message);

            while (System.Console.ReadKey().KeyChar != 'q')
            {
                System.Console.Clear();
                System.Console.WriteLine(message);
                if (a_game.Play())
                {
                    System.Console.WriteLine("You are a winner: {0} {1}", a_game.GetDice1Value(), a_game.GetDice2Value());
                }
                else
                {
                    System.Console.WriteLine("Sorry you lost: {0} {1}", a_game.GetDice1Value(), a_game.GetDice2Value());
                }
            }
        }