mirror of https://github.com/ppy/osu
Add nullability directive and make variant non-nullable
This commit is contained in:
parent
15e3f95c87
commit
a150fb2996
|
@ -5,6 +5,8 @@
|
|||
using osu.Game.Database;
|
||||
using Realms;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
[MapTo(@"RulesetSetting")]
|
||||
|
@ -16,12 +18,13 @@ public class RealmRulesetSetting : RealmObject, IHasGuidPrimaryKey
|
|||
[Indexed]
|
||||
public int RulesetID { get; set; }
|
||||
|
||||
public int? Variant { get; set; }
|
||||
[Indexed]
|
||||
public int Variant { get; set; }
|
||||
|
||||
public string Key { get; set; }
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
[MapTo(nameof(Value))]
|
||||
public string ValueString { get; set; }
|
||||
public string ValueString { get; set; } = string.Empty;
|
||||
|
||||
public object Value
|
||||
{
|
||||
|
|
|
@ -465,7 +465,7 @@ private void migrateDataToRealm()
|
|||
ValueString = dkb.StringValue,
|
||||
Key = dkb.Key,
|
||||
RulesetID = dkb.RulesetID.Value,
|
||||
Variant = dkb.Variant
|
||||
Variant = dkb.Variant ?? 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public abstract class RulesetConfigManager<TLookup> : ConfigManager<TLookup>, IR
|
|||
{
|
||||
private readonly RealmContextFactory realmFactory;
|
||||
|
||||
private readonly int? variant;
|
||||
private readonly int variant;
|
||||
|
||||
private List<RealmRulesetSetting> databasedSettings = new List<RealmRulesetSetting>();
|
||||
|
||||
|
@ -31,7 +31,7 @@ protected RulesetConfigManager(SettingsStore store, RulesetInfo ruleset, int? va
|
|||
|
||||
rulesetId = ruleset.ID ?? -1;
|
||||
|
||||
this.variant = variant;
|
||||
this.variant = variant ?? 0;
|
||||
|
||||
Load();
|
||||
|
||||
|
|
Loading…
Reference in New Issue