public void RemoveItem(TechType techType, EatableType eatableType)
        {
            var pickupable = techType.ToPickupable();

            if (Inventory.main.HasRoomFor(pickupable))
            {
                EatableEntities match = FindMatch(techType, eatableType);

                if (match != null)
                {
                    var go      = GameObject.Instantiate(CraftData.GetPrefabForTechType(techType));
                    var eatable = go.GetComponent <Eatable>();
                    var pickup  = go.GetComponent <Pickupable>();

                    match.UnpauseDecay();
                    eatable.timeDecayStart = match.TimeDecayStart;

                    if (Inventory.main.Pickup(pickup))
                    {
                        QuickLogger.Debug($"Removed Match Before || Fridge Count {FridgeItems.Count}");
                        FridgeItems.Remove(match);
                        QuickLogger.Debug($"Removed Match || Fridge Count {FridgeItems.Count}");
                    }
                    else
                    {
                        QuickLogger.Message(LanguageHelpers.GetLanguage("InventoryFull"), true);
                    }
                    GameObject.Destroy(pickupable);
                    OnContainerUpdate?.Invoke(NumberOfItems, _itemLimit);
                }
            }
        }
        private EatableEntities FindMatch(TechType techType, EatableType eatableType)
        {
            switch (eatableType)
            {
            case EatableType.Rotten:
                return(FridgeItems.FirstOrDefault(x => (x.GetFoodValue() < 0 && x.GetWaterValue() < 0) && x.TechType == techType));

            default:
                return(FridgeItems.FirstOrDefault(x => (x.GetFoodValue() > 0 || x.GetWaterValue() > 0) && x.TechType == techType));
            }
        }
        private void OnLoadDisplay(EatableType eatableType, GameObject itemPrefab, GameObject itemsGrid, int stPos, int endPos)
        {
            switch (eatableType)
            {
            case EatableType.Rotten:
                var rottenList = _mono.FridgeComponent.FridgeItems.Where(x => x.IsRotten()).ToList();
                _trashPage.ClearPage();
                CreateFoodItem(itemPrefab, itemsGrid, stPos, endPos, rottenList, _trashPage, EatableType.Rotten);
                break;

            case EatableType.Food:
                var freshList = _mono.FridgeComponent.FridgeItems.Where(x => x.GetFoodValue() > 0 && !x.IsRotten()).ToList();
                _foodPage.ClearPage();
                CreateFoodItem(itemPrefab, itemsGrid, stPos, endPos, freshList, _foodPage, EatableType.Food);
                break;

            case EatableType.Drink:
                var drinkList = _mono.FridgeComponent.FridgeItems.Where(x => x.GetFoodValue() <= 0 && x.GetWaterValue() > 0).ToList();
                _waterPage.ClearPage();
                CreateFoodItem(itemPrefab, itemsGrid, stPos, endPos, drinkList, _waterPage, EatableType.Drink);
                break;
            }
        }
        private void CreateFoodItem(GameObject itemPrefab, GameObject itemsGrid, int stPos, int endPos, List <EatableEntities> list, GridHelper page, EatableType eatableType)
        {
            var grouped = list.GroupBy(x => x.TechType).Select(x => x.First()).ToList();

            if (endPos > grouped.Count)
            {
                endPos = grouped.Count;
            }

            for (int i = stPos; i < endPos; i++)
            {
                var techType = grouped[i].TechType;

                GameObject foodIcon = Instantiate(itemPrefab);

                if (foodIcon == null || itemsGrid == null)
                {
                    if (foodIcon != null)
                    {
                        Destroy(foodIcon);
                    }
                    return;
                }

                foodIcon.transform.SetParent(itemsGrid.transform, false);

                foodIcon.GetComponentInChildren <Text>().text = "x" + list.Count(x => x.TechType == techType);

                var itemButton = foodIcon.AddComponent <ItemButton>();
                itemButton.Type          = techType;
                itemButton.EatableType   = eatableType;
                itemButton.OnButtonClick = _mono.FridgeComponent.RemoveItem;

                uGUI_Icon icon = InterfaceHelpers.FindGameObject(foodIcon, "ItemImage").AddComponent <uGUI_Icon>();
                icon.sprite = SpriteManager.Get(techType);
            }

            page.UpdaterPaginator(grouped.Count);
        }