From 56759bc710ae59e2b4d9451073346f6775d126ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Tue, 21 May 2024 12:12:31 +0200 Subject: [PATCH] Make some inventory description properties public --- .../Steam/Data/InventoryDescription.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ArchiSteamFarm/Steam/Data/InventoryDescription.cs b/ArchiSteamFarm/Steam/Data/InventoryDescription.cs index d5e001739..13de996c9 100644 --- a/ArchiSteamFarm/Steam/Data/InventoryDescription.cs +++ b/ArchiSteamFarm/Steam/Data/InventoryDescription.cs @@ -184,14 +184,8 @@ public sealed class InventoryDescription { } } - [JsonInclude] - [JsonPropertyName("type")] - public string TypeText { - get => Body.type; - private init => Body.type = value; - } - - internal EAssetRarity Rarity { + [JsonIgnore] + public EAssetRarity Rarity { get { if (CachedRarity.HasValue) { return CachedRarity.Value; @@ -256,7 +250,8 @@ public sealed class InventoryDescription { } } - internal uint RealAppID { + [JsonIgnore] + public uint RealAppID { get { if (CachedRealAppID.HasValue) { return CachedRealAppID.Value; @@ -312,7 +307,7 @@ public sealed class InventoryDescription { [JsonDisallowNull] [JsonInclude] [JsonPropertyName("tags")] - internal ImmutableHashSet Tags { + public ImmutableHashSet Tags { get => Body.tags.Select(static tag => new Tag(tag.category, tag.internal_name, tag.localized_category_name, tag.localized_tag_name, tag.color)).ToImmutableHashSet(); private init { @@ -337,12 +332,13 @@ public sealed class InventoryDescription { [JsonInclude] [JsonPropertyName("tradable")] [JsonRequired] - internal bool Tradable { + public bool Tradable { get => Body.tradable; private init => Body.tradable = value; } - internal EAssetType Type { + [JsonIgnore] + public EAssetType Type { get { if (CachedType.HasValue) { return CachedType.Value; @@ -509,6 +505,13 @@ public sealed class InventoryDescription { } } + [JsonInclude] + [JsonPropertyName("type")] + public string TypeText { + get => Body.type; + private init => Body.type = value; + } + private EAssetRarity? CachedRarity; private uint? CachedRealAppID; private EAssetType? CachedType;