diff --git a/BoosterManager/Commands.cs b/BoosterManager/Commands.cs index 8961d34..901c460 100644 --- a/BoosterManager/Commands.cs +++ b/BoosterManager/Commands.cs @@ -1139,10 +1139,7 @@ internal static class Commands { ItemIdentifier itemIdentifier; try { - itemIdentifier = new ItemIdentifier(itemIdentifierAsText); - if (marketable != null) { - itemIdentifier.Marketable = marketable; - } + itemIdentifier = new ItemIdentifier(itemIdentifierAsText, marketable); } catch (Exception) { return FormatBotResponse(bot, String.Format("Invalid Item Identifier: {0}", itemIdentifierAsText)); } @@ -1231,10 +1228,7 @@ internal static class Commands { ItemIdentifier itemIdentifier; try { - itemIdentifier = new ItemIdentifier(itemIdentifierAsText); - if (marketable != null) { - itemIdentifier.Marketable = marketable; - } + itemIdentifier = new ItemIdentifier(itemIdentifierAsText, marketable); } catch (Exception) { return FormatBotResponse(bot, String.Format("Invalid Item Identifier: {0}", itemIdentifierAsText)); } @@ -1362,10 +1356,7 @@ internal static class Commands { List itemIdentifiers = new List(); foreach (string itemIdentifierString in itemIdentifierStrings) { try { - ItemIdentifier itemIdentifier = new ItemIdentifier(itemIdentifierString); - if (marketable != null) { - itemIdentifier.Marketable = marketable; - } + ItemIdentifier itemIdentifier = new ItemIdentifier(itemIdentifierString, marketable); itemIdentifiers.Add(itemIdentifier); } catch (Exception) { return FormatBotResponse(bot, String.Format("Invalid Item Identifier: {0}", itemIdentifierString)); diff --git a/BoosterManager/Data/ItemIdentifier.cs b/BoosterManager/Data/ItemIdentifier.cs index 4660933..e9b884e 100644 --- a/BoosterManager/Data/ItemIdentifier.cs +++ b/BoosterManager/Data/ItemIdentifier.cs @@ -24,7 +24,9 @@ internal sealed class ItemIdentifier { internal ItemIdentifier() {} - internal ItemIdentifier(string identityString) { + internal ItemIdentifier(string identityString, bool? marketable = null) { + Marketable = marketable; + string[] ids = identityString.Split(Separator); uint appID; ulong contextID;