public BoxPathsRankingList GetAllBoxPathes_OrderByLowestSum() { IOrderedEnumerable <BoxPath> rList = this.OrderByDescending(boxPath => boxPath.Sum()); BoxPathsRankingList rankingList = new BoxPathsRankingList(); foreach (BoxPath bp in rList) { rankingList.Add(bp); } return(rankingList); }
public BoxPathsRankingList GetOnlyBoxPathes_WithLowestSum() { BoxPathsRankingList rankingList = new BoxPathsRankingList(); int lowestSum = GetLowestSum(); foreach (BoxPath boxPath in GetAllBoxPathes_OrderByLowestSum()) { if (boxPath.Sum() == lowestSum) { rankingList.Add(boxPath); } else { break; } } return(rankingList); }