public StreamTriggerScriptContext StreamTriggerScriptGetContext(FA mode, Phx.BTriggerScriptType type, string name) { return(new StreamTriggerScriptContext { FileInfo = GetFileInfo(mode, type, name), }); }
static Engine.XmlFileInfo GetFileInfo(FA mode, Phx.BTriggerScriptType type, string filename = null) { string root_name = Phx.BTriggerSystem.kXmlRootName; Engine.GameDirectory dir; var location = Engine.ContentStorage.Game; switch (type) { case Phx.BTriggerScriptType.TriggerScript: dir = Engine.GameDirectory.TriggerScripts; location = Engine.ContentStorage.UpdateOrGame; // TUs have only included updated TS files only break; case Phx.BTriggerScriptType.Scenario: dir = Engine.GameDirectory.Scenario; break; case Phx.BTriggerScriptType.Ability: dir = Engine.GameDirectory.AbilityScripts; break; case Phx.BTriggerScriptType.Power: dir = Engine.GameDirectory.PowerScripts; break; default: throw new KSoft.Debug.UnreachableException(type.ToString()); } return(new Engine.XmlFileInfo() { Location = location, Directory = dir, RootName = root_name, FileName = filename, Writable = mode == FA.Write, }); }