Beispiel #1
0
        bool IFCSStorage.IsAllowedToAdd(Pickupable pickupable, bool verbose)
        {
            var eatable = pickupable.gameObject.GetComponent <Eatable>();

            if (eatable != null)
            {
                if (eatable.decomposes && pickupable.GetTechType() != TechType.CreepvinePiece)
                {
                    QuickLogger.Message(ExStorageDepotBuildable.FoodNotAllowed(), true);
                    return(false);
                }
            }

            if (_mono.DumpContainer == null)
            {
                QuickLogger.Error("DumpContainer returned null");
                return(false);
            }

            if (!CanBeStored(_mono.DumpContainer.GetCount() + 1, pickupable.GetTechType()))
            {
                QuickLogger.Info(ExStorageDepotBuildable.NoMoreSpace(), true);
                return(false);
            }

            return(true);
        }
        private bool IsAllowedToAdd(Pickupable pickupable, bool verbose)
        {
            var containerTotal = ItemTotalCount + 1;

            if (_container.container.count >= _maxItems || containerTotal > _maxItems)
            {
                QuickLogger.Info(ExStorageDepotBuildable.NoMoreSpace(), true);
                return(false);
            }


            return(true);
        }