public void AddFieldBytes(FieldBytes fieldBytes) { if (OriginalBytes == null) { OriginalBytes = new List <FieldBytes>(); } OriginalBytes.Add(fieldBytes); }
public object AddOwnValue(FieldKey key, FieldBytes fieldBytes, bool sort = false) { var slice = fieldBytes.ByteSlice; Serializer.Instance.State = GameState.Instance.OriginalState; Serializer.Instance.State.StartLocalGroup(); var resolver = MessagePack.MessagePackSerializer.DefaultResolver; var value = FieldMeta.Get(key).Deserialize(slice.GetBytes(), slice.Offset, resolver, out int readSize); Serializer.Instance.State = null; SetValue(key, value); OwnValues.AddFieldBytes(fieldBytes); if (sort) { OwnValues.OriginalBytes.Sort(); } return(value); }