Esempio n. 1
0
        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");
                }
            }
        }
Esempio n. 2
0
        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)));
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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);
            }
        }