Ejemplo n.º 1
0
        public Command getCommand()
        {
            string inputLine = "";

            inputLine = Console.ReadLine();
            String[] values = inputLine.Split(' ', '\n');
            if (CommandWords.isCommand(values[0]))
            {
                if (values.Count() == 1)
                {
                    return new Command {
                               CommandWord = values[0], SecondWord = null
                    }
                }
            }
            ;
Ejemplo n.º 2
0
        public Command GetCommand()  //gets the use of the command to know how many words are needed
        {
            string inputLine = "> "; // allows input from the user

            inputLine = Console.ReadLine();
            inputLine.ToLower();
            String[] values = inputLine.Split(' ', '\n');
            if (CommandWords.IsCommand(values[0]))
            {
                if (values.Count() == 1) //counts how many words have been typed
                {
                    return new Command {
                               CommandWord = values[0], SecondWord = null
                    }
                }
            }
            ;                             //shows the second word as null as it wont be needed