using SptCommon.Annotations; using Core.Models.Eft.Common.Tables; namespace Core.Helpers; [Injectable] public class SecureContainerHelper(ItemHelper _itemHelper) { /// /// Get a list of the item IDs (NOT tpls) inside a secure container /// /// Inventory items to look for secure container in /// List of ids public List GetSecureContainerItems(List items) { var secureContainer = items.First((x) => x.SlotId == "SecuredContainer"); // No container found, drop out if (secureContainer is null) return []; var itemsInSecureContainer = _itemHelper.FindAndReturnChildrenByItems(items, secureContainer.Id); // Return all items returned and exclude the secure container item itself return itemsInSecureContainer.Where((x) => x != secureContainer.Id).ToList(); } }