示例#1
0
        public void LoadScripts(EngineWrapper engine, string dir)
        {
            _scripts.Clear();

            LoadDirectory(dir);
            foreach (var script in _scripts)
            {
                engine.Execute(File.ReadAllText(script.Value));
            }

            engine.AddHardCommand("reload", () => LoadScripts(engine, dir));
            _scripts.Add("reload", "hard");
        }
示例#2
0
文件: CommandStore.cs 项目: aevv/qcmd
        public void LoadScripts(EngineWrapper engine, string dir)
        {
            _scripts.Clear();

            LoadDirectory(dir);
            foreach (var script in _scripts)
            {
                engine.Execute(File.ReadAllText(script.Value));
            }

            engine.AddHardCommand("reload", () => LoadScripts(engine, dir));
            _scripts.Add("reload", "hard");
        }