コード例 #1
0
 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.ReadPackedFixedString64Delta(baseline.__GHOST_FIELD_NAME__, compressionModel);
     }
     else
     {
         snapshot.__GHOST_FIELD_NAME__ = baseline.__GHOST_FIELD_NAME__;
     }
     #endregion
 }
コード例 #2
0
        public void ReadWritePackedFixedString64Delta()
        {
            var dataStream       = new DataStreamWriter(300 * 4, Allocator.Temp);
            var compressionModel = new NetworkCompressionModel(Allocator.Temp);

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

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

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

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

            Assert.AreEqual(src, dst);
        }