mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Mark CreateConfig()
return type as nullable because it's not required all ruleset to implement.
Also, remove nullable disable annotation for all using classes. Setting store can be nullable because `RulesetConfigManager()` can accept null setting store.
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Concurrent;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Configuration;
|
||||
@ -14,8 +12,8 @@ namespace osu.Game.Tests.Rulesets
|
||||
/// </summary>
|
||||
public class TestRulesetConfigCache : IRulesetConfigCache
|
||||
{
|
||||
private readonly ConcurrentDictionary<string, IRulesetConfigManager> configCache = new ConcurrentDictionary<string, IRulesetConfigManager>();
|
||||
private readonly ConcurrentDictionary<string, IRulesetConfigManager?> configCache = new ConcurrentDictionary<string, IRulesetConfigManager?>();
|
||||
|
||||
public IRulesetConfigManager GetConfigFor(Ruleset ruleset) => configCache.GetOrAdd(ruleset.ShortName, _ => ruleset.CreateConfig(null));
|
||||
public IRulesetConfigManager? GetConfigFor(Ruleset ruleset) => configCache.GetOrAdd(ruleset.ShortName, _ => ruleset.CreateConfig(null));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user