示例#1
0
 public virtual void Deserialize(FArchive reader)
 {
     foreach (var tag in PropertyTag.ReadToEnd(reader))
     {
         Vars.Add(new TaggedItem(tag.Name, PropertyFactory.Get(reader.Slice(tag.Size), tag)));
         if (reader.Tell() != tag.PropertyEnd)
         {
             Console.WriteLine($"Needed to move by {tag.PropertyEnd - reader.Tell()} for {tag.Name} {(tag.TypeEnum == PropertyTag.PropertyType.StructProperty ? tag.StructName : tag.Type)}");
             reader.Seek(tag.PropertyEnd);
         }
     }
 }
示例#2
0
 public virtual FArchive Serialize(FArchive archive)
 {
     foreach (var tag in PropertyTag.ReadToEnd(archive))
     {
         Vars.Add(new TaggedItem(tag.Name, PropertyFactory.Get(archive.SubStream(tag.Size), tag)));
         if (archive.Tell() != tag.PropertyEnd)
         {
             Debug.WriteLine($"Needed to move by {tag.PropertyEnd - archive.Tell()} for {tag.Name} {(tag.TypeEnum == PropertyTag.PropertyType.StructProperty ? tag.StructName : tag.Type)}");
             archive.Seek(tag.PropertyEnd);
         }
     }
     return(archive);
 }