public Task <Eleon.Modding.ItemExchangeInfo> DoItemExchange(string title, string description, string buttonText, Eleon.Modding.ItemStack[] items)
        {
            var data = new Eleon.Modding.ItemExchangeInfo();

            data.id         = EntityId;
            data.title      = title;
            data.desc       = description;
            data.buttonText = buttonText;
            data.items      = items;

            return(_gameServerConnection.SendRequest <Eleon.Modding.ItemExchangeInfo>(Eleon.Modding.CmdId.Request_Player_ItemExchange, data));
        }
        private static double GetSellValueOfItems(Configuration.SellLocation sellLocation, Eleon.Modding.ItemExchangeInfo itemExchangeInfoInQuote)
        {
            double credits = 0;

            foreach (var stack in itemExchangeInfoInQuote.items)
            {
                double unitPrice;
                if (!sellLocation.ItemIdToUnitPrice.TryGetValue(stack.id, out unitPrice))
                {
                    unitPrice = sellLocation.DefaultPrice;
                }

                credits += unitPrice * stack.count;
            }

            return(System.Math.Round(credits, 2));
        }