Example #1
0
        public void Start()
        {
            while (true)
            {
                console.PrintStart();
                int menuOption = console.GetOption(menuOptions);
                switch (menuOption)
                {
                case 1:
                    game    = gameFactory.New("test player");
                    console = new ConsoleHandler(game);
                    RunGame();
                    break;

                case 2:
                    game    = gameFactory.Load();
                    console = new ConsoleHandler(game);
                    if (game != null)
                    {
                        RunGame();
                    }
                    break;

                case 3:
                    if (console.ConfirmSelection("quit game"))
                    {
                        Environment.Exit(0);
                        return;
                    }
                    break;

                default:
                    throw new ArgumentException("No such option: " + menuOption);
                }
            }
        }