mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
Kotz's editorconfig styles slightly modified. Target typed new usage. Brackets in expressions used for clarity.
This commit is contained in:
@@ -11,7 +11,7 @@ public sealed class BotConfigService : ConfigServiceBase<BotConfig>
|
||||
public override string Name { get; } = "bot";
|
||||
|
||||
private const string FilePath = "data/bot.yml";
|
||||
private static TypedKey<BotConfig> changeKey = new TypedKey<BotConfig>("config.bot.updated");
|
||||
private static readonly TypedKey<BotConfig> changeKey = new("config.bot.updated");
|
||||
|
||||
public BotConfigService(IConfigSeria serializer, IPubSub pubSub)
|
||||
: base(FilePath, serializer, pubSub, changeKey)
|
||||
|
@@ -41,5 +41,5 @@ public static class ConfigPrinters
|
||||
=> culture.Name;
|
||||
|
||||
public static string Color(Rgba32 color)
|
||||
=> ((uint) (color.B << 0 | color.G << 8 | color.R << 16)).ToString("X6");
|
||||
=> ((uint) ((color.B << 0) | (color.G << 8) | (color.R << 16))).ToString("X6");
|
||||
}
|
@@ -95,10 +95,10 @@ public abstract class ConfigServiceBase<TSettings> : IConfigService
|
||||
File.WriteAllText(_filePath, strData);
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, Func<TSettings, string, bool>> _propSetters = new Dictionary<string, Func<TSettings, string, bool>>();
|
||||
private readonly Dictionary<string, Func<object>> _propSelectors = new Dictionary<string, Func<object>>();
|
||||
private readonly Dictionary<string, Func<object, string>> _propPrinters = new Dictionary<string, Func<object, string>>();
|
||||
private readonly Dictionary<string, string> _propComments = new Dictionary<string, string>();
|
||||
private readonly Dictionary<string, Func<TSettings, string, bool>> _propSetters = new();
|
||||
private readonly Dictionary<string, Func<object>> _propSelectors = new();
|
||||
private readonly Dictionary<string, Func<object, string>> _propPrinters = new();
|
||||
private readonly Dictionary<string, string> _propComments = new();
|
||||
|
||||
protected void AddParsedProp<TProp>(
|
||||
string key,
|
||||
|
Reference in New Issue
Block a user