Move guid initialisation to database model itself

This commit is contained in:
Dean Herbert 2021-04-26 17:06:03 +09:00
parent 2c1422b4f9
commit 8961203f08
3 changed files with 1 additions and 3 deletions

View File

@ -12,7 +12,7 @@ namespace osu.Game.Input.Bindings
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey, IKeyBinding public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey, IKeyBinding
{ {
[PrimaryKey] [PrimaryKey]
public Guid ID { get; set; } public Guid ID { get; set; } = Guid.NewGuid();
public int? RulesetID { get; set; } public int? RulesetID { get; set; }

View File

@ -74,7 +74,6 @@ namespace osu.Game.Input
// insert any defaults which are missing. // insert any defaults which are missing.
usage.Realm.Add(new RealmKeyBinding usage.Realm.Add(new RealmKeyBinding
{ {
ID = Guid.NewGuid(),
KeyCombinationString = k.KeyCombination.ToString(), KeyCombinationString = k.KeyCombination.ToString(),
ActionInt = (int)k.Action, ActionInt = (int)k.Action,
RulesetID = rulesetId, RulesetID = rulesetId,

View File

@ -370,7 +370,6 @@ namespace osu.Game
{ {
usage.Realm.Add(new RealmKeyBinding usage.Realm.Add(new RealmKeyBinding
{ {
ID = Guid.NewGuid(),
KeyCombinationString = dkb.KeyCombination.ToString(), KeyCombinationString = dkb.KeyCombination.ToString(),
ActionInt = (int)dkb.Action, ActionInt = (int)dkb.Action,
RulesetID = dkb.RulesetID, RulesetID = dkb.RulesetID,