Пример #1
0
        private void GetCommand()
        {
            String command;

            if (Model != null)
            {
                do
                {
                    Console.WriteLine("Available Commands: {0}", Model.AvailableCommands());
                    Console.Write("Ready, {0}: ", Model.GetPlayer().PlayerName);
                    command = Console.ReadLine().ToLower();
                } while (!Controller.Execute(command));
            }
            else
            {
                throw new InvalidOperationException("The View lacks a corresponding Controller.");
            }
        }
Пример #2
0
        private void GetCommand()
        {
            String command;

            if (Model != null)
            {
                do
                {
                    OverWrite(0, 26, "Available Commands: " + Model.AvailableCommands(), ConsoleColor.Blue);
                    OverWrite(0, 27, "Ready, " + Model.GetPlayer().PlayerName + ": ", ConsoleColor.Green);

                    command = Console.ReadLine().ToLower();
                } while (!Controller.Execute(command));
            }
            else
            {
                throw new InvalidOperationException("The View lacks a corresponding Controller.");
            }
        }