public HostViewContext() { RootPath = GlobalCommon.HostCommon.RootPath; RunTimeLibPath = GlobalCommon.HostCommon.RootPath + HostJsConstants.COMPILED_ROOT_PATH; CommonLibPath = GlobalCommon.HostCommon.RootPath; var viewdoc = new ViewDocument(_currentjse); _hostobject.Add(viewdoc.Name, viewdoc); var console = new ConsoleObject(); _hostobject.Add(console.Name, console); var document = new JsDocument(_currentjse, RootPath); _hostobject.Add(document.Name, document); var loadtag = new LoadParser(); var reftag = new RefParser(); var copytag = new CopyParser(); var outtag = new OutTag(); var hjstag = new HjsTag(); //按照先后处理标签的顺序进行标签处理 _hosttag.Add(loadtag.TagName, loadtag); _hosttag.Add(reftag.TagName, reftag); _hosttag.Add(copytag.TagName, copytag); //out会变为hjs标签 _hosttag.Add(outtag.TagName, outtag); _hosttag.Add(hjstag.TagName, hjstag); }
public void Shift_Click(object sender, RoutedEventArgs e) { LoadParser level = GameState.GetLevel(); int start = 0; int end = 0; int shift = 0; int.TryParse(StartBox.Text, out start); int.TryParse(EndBox.Text, out end); int.TryParse(ShiftBox.Text, out shift); foreach (Loadable loadable in level.Loadables) { for (int i = 0; i < loadable.SpawningCycles.Count; i++) { int cycle = loadable.SpawningCycles[i]; if (start <= cycle && cycle <= end) { loadable.SpawningCycles[i] = cycle + shift; loadable.ForceNewPanel = true; } } } GameState.Get().MainWindow.ReloadLevel(); GameState.Get().TextEditWindow.DrawLoadablePanels(); this.Close(); }
// Takes all loadables and displays loadable panels public void DrawLoadablePanels() { LoadablePanels.Children.Clear(); LoadParser level = GameState.GetLevel(); if (level is null) { return; } IntComparison.QSort(level.Loadables); foreach (Loadable loadable in level.Loadables) { LoadablePanels.Children.Add((UIElement)loadable.GetLoadablePanel()); } }
public HostLogicContext() { _currentjse = HostJs.NewInstance(); var loadtag = new LoadParser(); var reftag = new RefParser(); var copytag = new CopyParser(); var actiontag = new ActionTag(); //按照先后处理标签的顺序进行标签处理 _hosttag.Add(loadtag.TagName, loadtag); _hosttag.Add(reftag.TagName, reftag); _hosttag.Add(copytag.TagName, copytag); _hosttag.Add(actiontag.TagName, actiontag); RootPath = GlobalCommon.HostCommon.RootPath; CommonLibPath = GlobalCommon.HostCommon.RootPath; RunTimeLibPath = GlobalCommon.HostCommon.RootPath + HostJsConstants.COMPILED_ROOT_PATH; }