ActivEarth.DAO.ContestDAO.CalculateBracketRewards C# (CSharp) Метод

CalculateBracketRewards() публичный статический Метод

Calculates the ActivityScore reward that will be awarded to teams in each bracket.
public static CalculateBracketRewards ( Contest contest ) : List
contest ActivEarth.Objects.Competition.Contests.Contest Contest to calculate rewards for. Must have teams loaded.
Результат List
        public static List<int> CalculateBracketRewards(Contest contest)
        {
            const float DIAMOND_POT_ALLOTMENT = 9;
            const float PLATINUM_POT_ALLOTMENT = 6;
            const float GOLD_POT_ALLOTMENT = 4;
            const float SILVER_POT_ALLOTMENT = 2;
            const float BRONZE_POT_ALLOTMENT = 1;

            List<int> sizes = ContestDAO.CalculateBracketSizes(contest.Teams.Count);

            float totalAllotments = 0;
            totalAllotments += DIAMOND_POT_ALLOTMENT * sizes[(int)ContestBracket.Diamond];
            totalAllotments += PLATINUM_POT_ALLOTMENT * sizes[(int)ContestBracket.Platinum];
            totalAllotments += GOLD_POT_ALLOTMENT * sizes[(int)ContestBracket.Gold];
            totalAllotments += SILVER_POT_ALLOTMENT * sizes[(int)ContestBracket.Silver];
            totalAllotments += BRONZE_POT_ALLOTMENT * sizes[(int)ContestBracket.Bronze];

            int bronzeReward = (int)Math.Round(contest.Reward * BRONZE_POT_ALLOTMENT / totalAllotments);
            int silverReward = (int)Math.Round(contest.Reward * SILVER_POT_ALLOTMENT / totalAllotments);
            int goldReward = (int)Math.Round(contest.Reward * GOLD_POT_ALLOTMENT / totalAllotments);
            int platinumReward = (int)Math.Round(contest.Reward * PLATINUM_POT_ALLOTMENT / totalAllotments);
            int diamondReward = (int)Math.Round(contest.Reward * DIAMOND_POT_ALLOTMENT / totalAllotments);

            return new List<int> { bronzeReward, silverReward, goldReward, platinumReward, diamondReward };
        }

Same methods

ContestDAO::CalculateBracketRewards ( int contestId ) : List