예제 #1
0
 public sealed override int WriteToBufferSize(uint revision)
 {
     if (DeltaEncoding)
     {
         int    count = NetBuffer.SizeofVWidth((ushort)Elements.Count);
         int    elementHeaderCount = 0;
         ushort changeCount        = 0;
         for (int i = 0; i < Elements.Count; i++)
         {
             Synchroniser element = Elements[i];
             if (element.ContainsRevision(revision))
             {
                 changeCount        += 1;
                 elementHeaderCount += NetBuffer.SizeofVWidth((ushort)i);
                 count += element.WriteToBufferSize(revision);
             }
         }
         count += NetBuffer.SizeofVWidth(changeCount);
         if (changeCount != Elements.Count)
         {
             count += elementHeaderCount;
         }
         return(count);
     }
     else
     {
         return(WriteToBufferSize());
     }
 }