Add default bot implementation (#3038)

* Add default bot implementation

* Thought so

* Brain damage for netf
This commit is contained in:
Łukasz Domeradzki
2023-10-18 22:57:58 +02:00
committed by GitHub
parent 52eacaf577
commit 5d467aca9a
5 changed files with 25 additions and 4 deletions

View File

@@ -60,6 +60,9 @@ public sealed class GlobalConfig {
[PublicAPI]
public const bool DefaultDebug = false;
[PublicAPI]
public const string? DefaultDefaultBot = null;
[PublicAPI]
public const byte DefaultFarmingDelay = 15;
@@ -208,6 +211,9 @@ public sealed class GlobalConfig {
[JsonProperty(Required = Required.DisallowNull)]
public bool Debug { get; private set; } = DefaultDebug;
[JsonProperty]
public string? DefaultBot { get; private set; } = DefaultDefaultBot;
[JsonProperty(Required = Required.DisallowNull)]
[Range(1, byte.MaxValue)]
public byte FarmingDelay { get; private set; } = DefaultFarmingDelay;
@@ -363,6 +369,9 @@ public sealed class GlobalConfig {
[UsedImplicitly]
public bool ShouldSerializeDebug() => !Saving || (Debug != DefaultDebug);
[UsedImplicitly]
public bool ShouldSerializeDefaultBot() => !Saving || (DefaultBot != DefaultDefaultBot);
[UsedImplicitly]
public bool ShouldSerializeFarmingDelay() => !Saving || (FarmingDelay != DefaultFarmingDelay);