ActivEarth.DAO.BadgeLevelInfoDAO.GetBadgeRequirement C# (CSharp) Метод

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

Retrieves the statistic requirement for a particular badge.
public static GetBadgeRequirement ( Statistic stat, int badgeLevel ) : float
stat Statistic Statistic for which the badge is awarded.
badgeLevel int Desired level of the badge.
Результат float
        public static float GetBadgeRequirement(Statistic stat, int badgeLevel)
        {
            using (SqlConnection connection = ConnectionManager.GetConnection())
            {
                var data = new ActivEarthDataProvidersDataContext(connection);
                float foundEntry = (from c in data.BadgeConstantsDataProviders
                                      where c.statistic == (byte)stat && c.level == badgeLevel
                                      select (float)c.requirement).FirstOrDefault();

                return (foundEntry >= 0 ? (float)foundEntry : float.PositiveInfinity);
            }
        }