public List <CocoRoleDressItemHolder> GetUnOwnedItemHoldersInList(List <CocoRoleDressItemHolder> inItemHolders, CocoDressStateModel stateModel, bool containTempOwned = true) { if (inItemHolders == null || inItemHolders.Count <= 0) { return(null); } var unOwnedItemHolders = inItemHolders.FindAll(itemHolder => { if (itemHolder.lockType == CocoLockType.Non && itemHolder.price <= 0) { return(false); } if (stateModel.IsItemPurchased(itemHolder.id)) { return(false); } if (!containTempOwned && stateModel.IsTempUnlocked(itemHolder.id)) { return(false); } return(true); }); return(unOwnedItemHolders); }
private List <CocoRoleDressItemHolder> GetUnOwnedItemHolders(CocoRoleDressSceneHolder sceneHolder, List <string> categoryIds, CocoDressStateModel stateModel, bool containTempOwned = true) { if (categoryIds == null || categoryIds.Count <= 0) { return(null); } var unOwnedItemHolders = new List <CocoRoleDressItemHolder> (); categoryIds.ForEach(categoryId => { if (!sceneHolder.CategoryItemHolderDic.ContainsKey(categoryId)) { return; } var sceneCategoryItemHolders = GetUnOwnedItemHoldersInList(sceneHolder.CategoryItemHolderDic [categoryId], stateModel, containTempOwned); if (sceneCategoryItemHolders != null && sceneCategoryItemHolders.Count > 0) { unOwnedItemHolders.AddRange(sceneCategoryItemHolders); } }); return(unOwnedItemHolders); }