示例#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");
                }
            }
        }
示例#2
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();
        }