mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Rename method to better indicate directionality
This commit is contained in:
parent
d1d4b54c64
commit
0d2396c557
@ -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));
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user