private void DeserializeData(NetDataReader reader) { int count = reader.GetInt(); data = new Dictionary <Item.Kind, StorageInfo>(count); for (int i = 0; i < count; i++) { var itemKind = (Item.Kind)reader.GetInt(); StorageInfo storageInfo = new StorageInfo(); storageInfo.Deserialize(reader); data.Add(itemKind, storageInfo); } }