Ejemplo n.º 1
0
        public static ModInfo[] ToInfo(ModInfoStruct[] structs, Analyzer analyzer)
        {
            if (structs == null)
            {
                return(null);
            }
            List <ModInfo> list = new List <ModInfo>();

            foreach (ModInfoStruct target in structs)
            {
                if (target.Structs != null)
                {
                    list.AddRange(ModInfoStruct.ToInfo(target.Structs, analyzer));
                }
                if (target.ID == null && target.Name == null)
                {
                    continue;
                }
                if (target.ID == null)
                {
                    target.ID = target.Name;
                }
                else if (target.Name == null)
                {
                    target.Name = target.ID;
                }
                list.Add(target.ToInfo(analyzer));
            }

            return(list.ToArray());
        }
Ejemplo n.º 2
0
 private ModInfo[] ReadFromInfoFile()
 {
     return(ModInfoStruct.ToInfo(ModInfoStruct.Load(this.ReadFileText("mcmod.info")), this));
 }