mirror of
https://github.com/ppy/osu
synced 2025-01-22 05:43:14 +00:00
Use OptIn
serialisation on SkinInfo
to avoid writing unnecessary information
This commit is contained in:
parent
cdf2fa9930
commit
e4b296e16e
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Extensions.ObjectExtensions;
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
@ -16,6 +17,7 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
[ExcludeFromDynamicCompile]
|
[ExcludeFromDynamicCompile]
|
||||||
[MapTo("Skin")]
|
[MapTo("Skin")]
|
||||||
|
[JsonObject(MemberSerialization.OptIn)]
|
||||||
public class SkinInfo : RealmObject, IHasRealmFiles, IEquatable<SkinInfo>, IHasGuidPrimaryKey, ISoftDelete, IHasNamedFiles
|
public class SkinInfo : RealmObject, IHasRealmFiles, IEquatable<SkinInfo>, IHasGuidPrimaryKey, ISoftDelete, IHasNamedFiles
|
||||||
{
|
{
|
||||||
internal static readonly Guid DEFAULT_SKIN = new Guid("2991CFD8-2140-469A-BCB9-2EC23FBCE4AD");
|
internal static readonly Guid DEFAULT_SKIN = new Guid("2991CFD8-2140-469A-BCB9-2EC23FBCE4AD");
|
||||||
@ -23,18 +25,22 @@ namespace osu.Game.Skinning
|
|||||||
internal static readonly Guid RANDOM_SKIN = new Guid("D39DFEFB-477C-4372-B1EA-2BCEA5FB8908");
|
internal static readonly Guid RANDOM_SKIN = new Guid("D39DFEFB-477C-4372-B1EA-2BCEA5FB8908");
|
||||||
|
|
||||||
[PrimaryKey]
|
[PrimaryKey]
|
||||||
|
[JsonProperty]
|
||||||
public Guid ID { get; set; } = Guid.NewGuid();
|
public Guid ID { get; set; } = Guid.NewGuid();
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
public string Name { get; set; } = string.Empty;
|
public string Name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
public string Creator { get; set; } = string.Empty;
|
public string Creator { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
|
public string InstantiationInfo { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string Hash { get; set; } = string.Empty;
|
public string Hash { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool Protected { get; set; }
|
public bool Protected { get; set; }
|
||||||
|
|
||||||
public string InstantiationInfo { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public virtual Skin CreateInstance(IStorageResourceProvider resources)
|
public virtual Skin CreateInstance(IStorageResourceProvider resources)
|
||||||
{
|
{
|
||||||
var type = string.IsNullOrEmpty(InstantiationInfo)
|
var type = string.IsNullOrEmpty(InstantiationInfo)
|
||||||
|
Loading…
Reference in New Issue
Block a user