public int ParseEntries(string serializedData, OriginFile file)
        {
            var list = new EmCollectionListT();

            bool successfullyParsed = list.Deserialize(serializedData);

            if (!successfullyParsed)
            {
                return(-1); // Error case
            }
            if (list.Count == 0)
            {
                return(0); // No entries
            }
            int count = 0;

            foreach (CustomCraftEntry item in list)
            {
                item.Origin = file;
                this.ParsedEntries.Add(item);
                count++;
            }

            return(count); // Return the number of unique entries added in this list
        }
Example #2
0
 internal static OriginFile GetOriginFile(string fileName)
 {
     if (KnownFiles.TryGetValue(fileName, out OriginFile file))
     {
         return(file);
     }
     else
     {
         var newEntry = new OriginFile(fileName);
         KnownFiles.Add(fileName, newEntry);
         return(newEntry);
     }
 }