Esempio n. 1
0
        public List <StoneType> CalcMostStoneTypes(StoneTypes stoneTypes)
        {
            Dictionary <StoneType, int> counter = CountStones(stoneTypes);
            int maxCount = counter.OrderBy(x => x.Value).First().Value;

            return(counter.Where(x => x.Value >= maxCount).Select(x => x.Key).ToList());
        }
Esempio n. 2
0
        public Dictionary <StoneType, int> CountStones(StoneTypes stoneTypes)
        {
            Dictionary <StoneType, int> counter = new Dictionary <StoneType, int>();

            foreach (var stoneType in stoneTypes.Types)
            {
                counter.Add(stoneType, CountStone(stoneType));
            }
            return(counter);
        }