// --- // TODO: Can't use `Serialization.Collections` utilities because can't // implement `INetSerializable` on `Item.Kind` or `Option<Item.Kind>`. // For now we'll just do it manually. private void SerializeData(NetDataWriter writer) { int count = data.Count; writer.Put(count); foreach (KeyValuePair <Item.Kind, StorageInfo> pair in data) { Item.Kind itemKind = pair.Key; StorageInfo storageInfo = pair.Value; writer.Put((int)pair.Key); storageInfo.Serialize(writer); } }