コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }