Make HitSampleInfo immutable

This commit is contained in:
smoogipoo
2020-12-01 15:37:51 +09:00
parent 76919a5772
commit 5760e1c1fc
19 changed files with 144 additions and 126 deletions

View File

@ -101,7 +101,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
case TernaryState.True:
if (existingSample == null)
samples.Add(new HitSampleInfo { Name = sampleName });
samples.Add(new HitSampleInfo(sampleName));
break;
}
}
@ -212,7 +212,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (blueprint != null)
{
// doing this post-creations as adding the default hit sample should be the case regardless of the ruleset.
blueprint.HitObject.Samples.Add(new HitSampleInfo { Name = HitSampleInfo.HIT_NORMAL });
blueprint.HitObject.Samples.Add(new HitSampleInfo(HitSampleInfo.HIT_NORMAL));
placementBlueprintContainer.Child = currentPlacement = blueprint;

View File

@ -328,7 +328,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (h.Samples.Any(s => s.Name == sampleName))
continue;
h.Samples.Add(new HitSampleInfo { Name = sampleName });
h.Samples.Add(new HitSampleInfo(sampleName));
}
EditorBeatmap.EndChange();