Example #1
0
        /// <summary>
        /// Executes the current command string
        /// </summary>
        public void ExecuteCommand()
        {
            String[] parameters = currentCommand.Split(new char[] { ' ' });
            String   cmdName    = parameters[0];

            try
            {
                switch ((Commands)Enum.Parse(typeof(Commands), cmdName.ToUpper()))
                {
                case Commands.INVOKE:
                    Invoke(parameters);
                    break;

                case Commands.FPS:
                    sim.UI.ToggleFPS();
                    break;

                case Commands.QUIT:
                    sim.Exit();
                    break;
                }
                ;
            }
            catch
            {
                SendError("Unrecognized command: " + currentCommand);
            }

            AddCommandToHistory();
            ClearCommand();
        }