mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08: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 modBool = new TestNonMatchingSettingTypeModBool { TestSetting = { Default = false, Value = true } };
|
||||||
var modInt = new TestNonMatchingSettingTypeModInt { TestSetting = { Value = (int)setting_change / 2 } };
|
var modInt = new TestNonMatchingSettingTypeModInt { TestSetting = { Value = (int)setting_change / 2 } };
|
||||||
|
|
||||||
modDouble.CopyCommonSettings(modBool);
|
modDouble.CopyCommonSettingsFrom(modBool);
|
||||||
modDouble.CopyCommonSettings(modInt);
|
modDouble.CopyCommonSettingsFrom(modInt);
|
||||||
modBool.CopyCommonSettings(modDouble);
|
modBool.CopyCommonSettingsFrom(modDouble);
|
||||||
modBool.CopyCommonSettings(modInt);
|
modBool.CopyCommonSettingsFrom(modInt);
|
||||||
modInt.CopyCommonSettings(modDouble);
|
modInt.CopyCommonSettingsFrom(modDouble);
|
||||||
modInt.CopyCommonSettings(modBool);
|
modInt.CopyCommonSettingsFrom(modBool);
|
||||||
|
|
||||||
Assert.That(modDouble.TestSetting.Value, Is.EqualTo(setting_change));
|
Assert.That(modDouble.TestSetting.Value, Is.EqualTo(setting_change));
|
||||||
Assert.That(modBool.TestSetting.Value, Is.EqualTo(!modBool.TestSetting.Default));
|
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 modBoolTrue = new TestNonMatchingSettingTypeModBool { TestSetting = { Default = true, Value = false } };
|
||||||
var modBoolFalse = new TestNonMatchingSettingTypeModBool { TestSetting = { Default = false, Value = true } };
|
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.Default, Is.EqualTo(false));
|
||||||
Assert.That(modBoolFalse.TestSetting.Value, Is.EqualTo(modBoolTrue.TestSetting.Value));
|
Assert.That(modBoolFalse.TestSetting.Value, Is.EqualTo(modBoolTrue.TestSetting.Value));
|
||||||
|
@ -633,7 +633,7 @@ namespace osu.Game
|
|||||||
var convertedMods = SelectedMods.Value.Select(mod =>
|
var convertedMods = SelectedMods.Value.Select(mod =>
|
||||||
{
|
{
|
||||||
var newMod = instance.CreateModFromAcronym(mod.Acronym);
|
var newMod = instance.CreateModFromAcronym(mod.Acronym);
|
||||||
newMod?.CopyCommonSettings(mod);
|
newMod?.CopyCommonSettingsFrom(mod);
|
||||||
return newMod;
|
return newMod;
|
||||||
}).Where(newMod => newMod != null).ToList();
|
}).Where(newMod => newMod != null).ToList();
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Copied values are unchanged, even if they have different clamping ranges.</remarks>
|
/// <remarks>Copied values are unchanged, even if they have different clamping ranges.</remarks>
|
||||||
/// <param name="source">The mod to extract settings from.</param>
|
/// <param name="source">The mod to extract settings from.</param>
|
||||||
public void CopyCommonSettings(Mod source)
|
public void CopyCommonSettingsFrom(Mod source)
|
||||||
{
|
{
|
||||||
if (source.UsesDefaultConfiguration)
|
if (source.UsesDefaultConfiguration)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user