private static void MainMenu(dynamic game) { bool isRunning; string[] cmds = game.Commands; do { Console.Clear(); int selected = MultipleChoice.Show("Main Menu", cmds); Console.Clear(); isRunning = game.HandleCommand(selected); } while (isRunning); }
static void Main(string[] args) { Console.CursorVisible = false; Load(); do { Console.Clear(); int item = MultipleChoice.Show("Choose an Action", commands); Console.Clear(); Controller.HandleInput(item); } while (isRunning); }
private static void CreateGame() { int typeSelection = MultipleChoice.Show("Select game", GameTypeMethods.GetAllFullNames()) + 1; GameType gameType = (GameType)Enum.GetValues(typeof(GameType)).GetValue(typeSelection); Console.WriteLine(); int players = NumberInput.Show("How many players", gameType.Minimum(), gameType.Maximum()); Console.Clear(); string[] names = LineEditor.RequestStringBatch("Enter player names", players); Console.Clear(); if (names != null) { dynamic game = gameType.CreateGame(names); MainMenu(game); } }