private static Tag ToTag(object obj, PropertyInfo info, NbtPropertyAttribute attrib) { if (attrib is NbtListAttribute && obj is IList) { return(ToTagList(obj, (attrib as NbtListAttribute).SubType ?? TagType.End)); } else { return(ToTag(obj, attrib.Type ?? InferType(info.PropertyType))); } }
private static object FromTag(Tag tag, PropertyInfo info, NbtPropertyAttribute attrib) { return(FromTag(tag, info.PropertyType)); }