public GEvent(string file) { this.file = file; this.parse = ModElementLoader.Load <GEventParse>(file, File.ReadAllText(file)); this.key = Path.GetFileNameWithoutExtension(file); this.title = new Title(parse.title, key); this.desc = new Desc(parse.desc, key); this.options = parse.options.Select((v, i) => new Option { semantic = v, index = i + 1, ownerName = Path.GetFileNameWithoutExtension(file) }).ToArray(); if (this.parse.trigger is ConditionDefault && !this.parse.trigger.Rslt()) { } else { if (this.parse.occur == null) { throw new Exception("event must have occur when trigger is not default false"); } } }
internal static Common Load(string name, string path) { var file = path + "/common_define.txt"; if (!File.Exists(file)) { return(new Common()); } return(ModElementLoader.Load <Common>(file, File.ReadAllText(file))); }
public InitSelect(string file) { this.file = file; this.key = Path.GetFileNameWithoutExtension(file); var sematic = ModElementLoader.Load <InitSelectSematic>(file, File.ReadAllText(file)); isFirst = sematic.isFirst != null && sematic.isFirst.Value; desc = new Desc(null, Path.GetFileNameWithoutExtension(file)); options = sematic.options.Select((v, i) => new Option { semantic = v, index = i + 1, ownerName = Path.GetFileNameWithoutExtension(file) }).ToArray(); }
internal static void Load(string name, string path, ref List <Warn> list) { if (!Directory.Exists(path)) { return; } foreach (var file in Directory.EnumerateFiles(path, "*.txt")) { var warn = ModElementLoader.Load <Warn>(file, File.ReadAllText(file)); warn.file = file; list.Add(warn); } }