BF2Statistics.MedalData.Award.Exists C# (CSharp) Method

Exists() public static method

Returns whether a specified award ID exists
public static Exists ( string AwardId ) : bool
AwardId string The Award ID
return bool
        public static bool Exists(string AwardId)
        {
            if (AwardId.Contains('_'))
                AwardId = AwardId.Split('_')[0];

            return StatsConstants.Awards.ContainsKey(AwardId);
        }

Usage Example

        public MedalOrRankCondition(List <string> Params)
        {
            if (Params[0] == "has_medal")
            {
                if (!Award.Exists(Params[1]) && Params[1] != "6666666" && Params[1] != "6666667")
                {
                    throw new Exception("[MedalCondition] Award ID: " + Params[1] + " Does not exist!");
                }
            }

            this.Params = Params;
        }