private static void SelectGoods(ICollection <GoodsNode> goods, PremiumUiShopSystem.BaseUserNode selfUser, List <GoodsNode> sortedGoods) { int rank = selfUser.userRank.Rank; foreach (GoodsNode node in goods) { int minRank = node.premiumOffer.MinRank; int maxRank = node.premiumOffer.MaxRank; if ((rank >= minRank) && (rank < maxRank)) { sortedGoods.Add(node); } } }
public void FillInfoElements(NodeAddedEvent e, SingleNode <PremiumLearnMoreComponent> infoUi, [JoinAll] ICollection <GoodsNode> goods, [JoinAll] PremiumUiShopSystem.BaseUserNode selfUser) { List <GoodsNode> sortedGoods = new List <GoodsNode>(); SelectGoods(goods, selfUser, sortedGoods); sortedGoods.Sort(new PremiumGoodsNodeComparer()); this.FillElements(sortedGoods, infoUi); }