From 1917c9da95d0ac3d7b630ba7fe678d118f5403b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Tue, 28 May 2024 19:07:48 +0200 Subject: [PATCH] Misc --- .../TradeStatistics.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/ArchiSteamFarm.OfficialPlugins.Monitoring/TradeStatistics.cs b/ArchiSteamFarm.OfficialPlugins.Monitoring/TradeStatistics.cs index fbb2206835c1a..d7572fb61a9b7 100644 --- a/ArchiSteamFarm.OfficialPlugins.Monitoring/TradeStatistics.cs +++ b/ArchiSteamFarm.OfficialPlugins.Monitoring/TradeStatistics.cs @@ -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 void Include(ParseTradeResult result) { 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; }