Rename method to better indicate directionality

This commit is contained in:
Bartłomiej Dach 2023-05-04 18:15:12 +02:00
parent d1d4b54c64
commit 0d2396c557
No known key found for this signature in database
3 changed files with 9 additions and 9 deletions

View File

@ -45,12 +45,12 @@ namespace osu.Game.Tests.Mods
var modBool = new TestNonMatchingSettingTypeModBool { TestSetting = { Default = false, Value = true } };
var modInt = new TestNonMatchingSettingTypeModInt { TestSetting = { Value = (int)setting_change / 2 } };
modDouble.CopyCommonSettings(modBool);
modDouble.CopyCommonSettings(modInt);
modBool.CopyCommonSettings(modDouble);
modBool.CopyCommonSettings(modInt);
modInt.CopyCommonSettings(modDouble);
modInt.CopyCommonSettings(modBool);
modDouble.CopyCommonSettingsFrom(modBool);
modDouble.CopyCommonSettingsFrom(modInt);
modBool.CopyCommonSettingsFrom(modDouble);
modBool.CopyCommonSettingsFrom(modInt);
modInt.CopyCommonSettingsFrom(modDouble);
modInt.CopyCommonSettingsFrom(modBool);
Assert.That(modDouble.TestSetting.Value, Is.EqualTo(setting_change));
Assert.That(modBool.TestSetting.Value, Is.EqualTo(!modBool.TestSetting.Default));
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Mods
var modBoolTrue = new TestNonMatchingSettingTypeModBool { TestSetting = { Default = true, Value = false } };
var modBoolFalse = new TestNonMatchingSettingTypeModBool { TestSetting = { Default = false, Value = true } };
modBoolFalse.CopyCommonSettings(modBoolTrue);
modBoolFalse.CopyCommonSettingsFrom(modBoolTrue);
Assert.That(modBoolFalse.TestSetting.Default, Is.EqualTo(false));
Assert.That(modBoolFalse.TestSetting.Value, Is.EqualTo(modBoolTrue.TestSetting.Value));

View File

@ -633,7 +633,7 @@ namespace osu.Game
var convertedMods = SelectedMods.Value.Select(mod =>
{
var newMod = instance.CreateModFromAcronym(mod.Acronym);
newMod?.CopyCommonSettings(mod);
newMod?.CopyCommonSettingsFrom(mod);
return newMod;
}).Where(newMod => newMod != null).ToList();

View File

@ -168,7 +168,7 @@ namespace osu.Game.Rulesets.Mods
/// </summary>
/// <remarks>Copied values are unchanged, even if they have different clamping ranges.</remarks>
/// <param name="source">The mod to extract settings from.</param>
public void CopyCommonSettings(Mod source)
public void CopyCommonSettingsFrom(Mod source)
{
if (source.UsesDefaultConfiguration)
return;