Example #1
0
 public void Serialize(Package package)
 {
     package.WriteUInt16((ushort)Version);
     Flags.Serialize(package);
     ObjectTablePtr = new ChunkPtr(0, (uint)package.FileOffset);
     ChunkPtr.Null.Serialize(package);
 }
Example #2
0
 public Chunk(Package package, ChunkPtr ptr, bool deserialize = true)
 {
     Ptr = ptr;
     if (deserialize)
     {
         Deserialize(package);
     }
 }
Example #3
0
        public void Deserialize(Package package)
        {
            if (Ptr.OffsetInFile == 0)
            {
                Ptr = ChunkPtr.Deserialize(package);
            }

            var offset = package.FileOffset;

            package.FileOffset = Ptr.OffsetInFile;
            _linkedObject      = new T();
            if (package.Header.Version < PackageVersion.Hydra_V0_1)
            {
                _linkedObject.Deserialize(package, Ptr.EntryCount);
            }
            else
            {
                _linkedObject.Deserialize(package);
            }
            package.FileOffset = offset;
        }
Example #4
0
 public Chunk(uint count, uint offset, T linkedObject)
 {
     Ptr           = new ChunkPtr(count, offset);
     _linkedObject = linkedObject;
 }
Example #5
0
 public void Deserialize(Package package)
 {
     Version = (PackageVersion)package.ReadUInt16();
     Flags.SetFlag(package.ReadUInt16());
     ObjectTablePtr = ChunkPtr.Deserialize(package);
 }