This commit is contained in:
Łukasz Domeradzki 2024-05-28 19:07:48 +02:00
parent 668bf5009b
commit 1917c9da95
No known key found for this signature in database
GPG key ID: 6B138B4C64555AEA

View file

@ -30,17 +30,11 @@ internal sealed class TradeStatistics {
private readonly object Lock = new();
internal uint AcceptedOffers { get; private set; }
internal uint BlacklistedOffers { get; private set; }
internal uint ConfirmedOffers { get; private set; }
internal uint IgnoredOffers { get; private set; }
internal uint ItemsGiven { get; private set; }
internal uint ItemsReceived { get; private set; }
internal uint RejectedOffers { get; private set; }
internal void Include(ParseTradeResult result) {
@ -49,25 +43,26 @@ internal sealed class TradeStatistics {
lock (Lock) {
switch (result.Result) {
case ParseTradeResult.EResult.Accepted when result.Confirmed:
++ConfirmedOffers;
ConfirmedOffers++;
ItemsGiven += (uint) (result.ItemsToGive?.Count ?? 0);
ItemsReceived += (uint) (result.ItemsToReceive?.Count ?? 0);
goto case ParseTradeResult.EResult.Accepted;
case ParseTradeResult.EResult.Accepted:
++AcceptedOffers;
AcceptedOffers++;
break;
case ParseTradeResult.EResult.Rejected:
++RejectedOffers;
RejectedOffers++;
break;
case ParseTradeResult.EResult.Blacklisted:
++BlacklistedOffers;
BlacklistedOffers++;
break;
case ParseTradeResult.EResult.Ignored:
++IgnoredOffers;
IgnoredOffers++;
break;
}