Example #1
0
        private void Run()
        {
            // Let the IoC container take care of injecting the things the Game object
            // needs to run.
            Game game = _container.GetInstance <Game>();

            game.Init();
            game.DisplayRules();

            while (!game.IsOver)
            {
                game.Play();
            }

            game.DisplayResults();

            if (!game.WasSuccessful)
            {
                game.ShowHowItsDone(); // <-- run the Solver
            }
            // Give the user a moment to accept the outcome... for better or worse.
            game.PauseForEffect();
        }