- Added Cloneable deep clone source generator nuget package

- Configs are no cloned using generated clone, not by serializing/deserializing
- Arrays/Lists (collections in geneeral) are still not cloned properly
- Removed GetRawData from config as it is no longer needed, new clone is very fast
- Added ICloneable<T> which all configs implement
- Cleaned up config classes/code
This commit is contained in:
Kwoth
2021-07-06 17:08:16 +02:00
parent a8a4c9fb44
commit 0fc5f540d8
15 changed files with 237 additions and 236 deletions

View File

@@ -13,10 +13,10 @@ namespace NadekoBot.Modules.Gambling.Common
}
private readonly IOrderedEnumerable<GamblingConfig.BetRollConfig.Pair> _thresholdPairs;
private readonly IOrderedEnumerable<BetRollPair> _thresholdPairs;
private readonly Random _rng;
public Betroll(GamblingConfig.BetRollConfig settings)
public Betroll(BetRollConfig settings)
{
_thresholdPairs = settings.Pairs.OrderByDescending(x => x.WhenAbove);
_rng = new Random();