예제 #1
0
        internal static string RarityString(this MagicItemRarity rarity)
        {
            switch (rarity)
            {
            case MagicItemRarity.VeryRare:
                return("Very Rare");

            case MagicItemRarity.Undefined:
                throw new IndexOutOfRangeException("Unexpected Error getting rarity string - Rarity Undefined: " + rarity.ToString());

            default:
                return(rarity.ToString());
            }
        }
예제 #2
0
 public static string Description(this MagicItemRarity val)
 {
     DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
     return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
 }