Example #1
0
        public void BSerialize(BinaryWriter writer, FPackageFileSummary summary)
        {
            int index = summary.Names.Select((FNameEntry x, int i) => new
            {
                name  = x.Name,
                index = i
            }).First(x => x.name.Equals("None")).index;
            FName instance = new FName
            {
                Index = index
            };

            using (Enumerator enumerator = GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    FPropertyTag current = enumerator.Current;
                    BSerializer.Serialize(writer, current.GetType(), current);
                    current.BSerialize(writer, summary);
                }
            }
            BSerializer.Serialize(writer, typeof(FName), instance);
            if (ObjectData != null)
            {
                writer.BaseStream.Position += 4L;
                ObjectData.BSerialize(writer, summary);
            }
        }