internal bool TransferToExStorage(TechType item) { foreach (FCSConnectableDevice connectableDevice in _storagesList) { if (connectableDevice.CanBeStored(1, item)) { return(connectableDevice.AddItemToContainer(item.ToInventoryItem(), out var reason)); } } return(false); }
/// <summary> /// Removes item from container and sends to another device /// </summary> /// <param name="techType"></param> /// <param name="deviceStorage"></param> /// <returns></returns> internal bool TransferItem(TechType techType, IFCSStorage deviceStorage) { try { //Remove item from container var isRemoved = RemoveItemFromContainer(techType); if (isRemoved) { var canBeStored = deviceStorage.CanBeStored(1, techType); if (canBeStored) { deviceStorage.AddItemToContainer(techType.ToInventoryItem()); } } } catch (Exception e) { QuickLogger.Error <FCSDeepDrillerContainer>(e.Message); QuickLogger.Error <FCSDeepDrillerContainer>(e.StackTrace); } return(true); }