Refactor exposed mod retrieval methods for better safety

This commit is contained in:
Dean Herbert
2021-09-10 11:09:13 +09:00
parent ce6b022a90
commit cf633973a9
19 changed files with 75 additions and 64 deletions

View File

@ -48,7 +48,7 @@ namespace osu.Game.Online.API
public Mod ToMod(Ruleset ruleset)
{
Mod resultMod = ruleset.GetModForAcronym(Acronym);
Mod resultMod = ruleset.CreateModFromAcronym(Acronym);
if (resultMod == null)
throw new InvalidOperationException($"There is no mod in the ruleset ({ruleset.ShortName}) matching the acronym {Acronym}.");