示例#1
0
        /// <summary>
        /// Started program method
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            BoardUI.PrintWelcomeMessage();

            MenuEnum option;

            do
            {
                option = BoardUI.PrintAndReadMenuOptions(Game.GetMenuOptions());

                switch (option)
                {
                case MenuEnum.StartGame:
                    StartGame();
                    BoardUI.PrintWelcomeMessage();
                    break;

                case MenuEnum.ListPlayers:
                    BoardUI.PrintPlayers(Game.GetPlayers());
                    break;

                case MenuEnum.AddPlayer:
                    Game.AddPlayer(BoardUI.ReadPlayer(Game.GetPlayers()));
                    break;

                case MenuEnum.ListItems:
                    BoardUI.PrintItems(Game.GetItems());
                    break;

                case MenuEnum.AddItem:
                    Game.AddItem(BoardUI.ReadItem(Game.GetItems()));
                    break;

                case MenuEnum.RemoveItem:
                    Game.RemoveItem(BoardUI.ReadRemoveItem(Game.GetItems()));
                    break;

                case MenuEnum.RemovePlayer:
                    Game.RemovePlayer(BoardUI.ReadRemovePlayer(Game.GetPlayers()));
                    break;

                case MenuEnum.DefaultPlayers:
                    SetTestPlayers();
                    break;

                case MenuEnum.ResetGame:
                    Game = new Game();
                    break;

                default:
                    break;
                }
            } while (!option.Equals(MenuEnum.EndGame));

            BoardUI.PrintByeByeMessage();
        }