示例#1
0
        public override void GameManagerAlive()
        {
            Instance = this;
            GUI.MenuController.AddMenu <ConsoleMenu>(new KeyCode[] { KeyCode.F2, KeyCode.BackQuote, KeyCode.Slash });
            _Executor = new Parser.Executor((name, args, history_index) => {
                Command cmd = ResolveCommand(name);
                if (history_index == null && History.LastIndex > 0)
                {
                    history_index = History.LastIndex - 1;
                }
                return(cmd.Run(args, history_index));
            });

            NormalHistory = new CommandHistory(_Executor, _Parser);
            LuaHistory    = new CommandHistory(_Executor, _Parser);

            Logger.Info($"Console v{Version} loaded");
        }
示例#2
0
 public CommandHistory(Parser.Executor exec, Parser.Parser parser)
 {
     _Executor = exec;
     _Parser   = parser;
 }