public void Deserialize(ref Snapshot snapshot, ref Snapshot baseline, ref DataStreamReader reader, ref NetworkCompressionModel compressionModel, uint changeMask)
 {
     #region __GHOST_READ__
     if ((changeMask__GHOST_MASK_BATCH__ & (1 << __GHOST_MASK_INDEX__)) != 0)
     {
         snapshot.__GHOST_FIELD_NAME__ = reader.ReadPackedFixedString128Delta(baseline.__GHOST_FIELD_NAME__, compressionModel);
     }
     else
     {
         snapshot.__GHOST_FIELD_NAME__ = baseline.__GHOST_FIELD_NAME__;
     }
     #endregion
 }
Exemplo n.º 2
0
        public void ReadWritePackedFixedString128Delta()
        {
            var dataStream       = new DataStreamWriter(300 * 4, Allocator.Temp);
            var compressionModel = new NetworkCompressionModel(Allocator.Temp);

            var src      = new FixedString128("This is a string");
            var baseline = new FixedString128("This is another string");

            dataStream.WritePackedFixedString128Delta(src, baseline, compressionModel);
            dataStream.Flush();

            //Assert.LessOrEqual(dataStream.Length, src.LengthInBytes+2);

            var reader = new DataStreamReader(dataStream.AsNativeArray());
            var dst    = reader.ReadPackedFixedString128Delta(baseline, compressionModel);

            Assert.AreEqual(src, dst);
        }