private ShopPurchaseResponse.ShopPurchaseResult ValidatePurchase(GameNetworkContext context, ShopPurchaseRequest shopRequest, ref int goldCost, ref int apCost, ref int charmCost, ref int newCharacters)
        {
            int count = 0;

            foreach (var item in shopRequest.Items)
            {
                if (_shopItemDataStore.TryGetValue(item.Index, out ShopItem shopItem))
                {
                    if (shopItem.Enable == false && shopItem.CategoryType != ShopCategoryType.Parts)
                    {
                        return(ShopPurchaseResponse.ShopPurchaseResult.NotForSale);
                    }

                    if (shopItem.CategoryType == ShopCategoryType.Parts)
                    {
                        if (_itemPartDataStore.TryGetValue(shopItem.Item0, out ItemPart itemPart))
                        {
                            if (!itemPart.Hero.Is(context.Character.HeroType) && shopItem.Hero.IsStrict(HeroType.All))
                            {
                                return(ShopPurchaseResponse.ShopPurchaseResult.NotForSaleForCurrentHero);
                            }
                        }
                    }

                    if (shopItem.PriceType == ShopPriceType.Gold)
                    {
                        goldCost += shopItem.Price0;
                    }
                    else if (shopItem.PriceType == ShopPriceType.Ap)
                    {
                        apCost += shopItem.Price0;
                    }
                    if (shopItem.Couple)
                    {
                        charmCost += shopItem.CouplePrice;
                    }

                    if (shopItem.Item1 != 0 && !shopItem.Hero.IsStrict(HeroType.All))
                    {
                        newCharacters += 1;
                    }
                    count += shopItem.Items.Length;
                }
            }
            if (context.Items.Count + count > context.Character.PocketSize)
            {
                return(ShopPurchaseResponse.ShopPurchaseResult.PocketSizeLimit);
            }
            return(ShopPurchaseResponse.ShopPurchaseResult.Success);
        }