static ClassToArmorModelSlot() { System.Collections.Generic.List <Type> list = new System.Collections.Generic.List <Type>(); foreach (Type type in typeof(ArmorModelSlotUtility.ClassToArmorModelSlot).Assembly.GetTypes()) { if ((type.IsSubclassOf(typeof(ArmorModel)) && !type.IsAbstract) && type.IsDefined(typeof(ArmorModelSlotClassAttribute), false)) { list.Add(type); } } ArmorModelSlotToType = new Dictionary <ArmorModelSlot, Type>(list.Count); foreach (Type type2 in list) { ArmorModelSlotClassAttribute customAttribute = (ArmorModelSlotClassAttribute)Attribute.GetCustomAttribute(type2, typeof(ArmorModelSlotClassAttribute)); ArmorModelSlotToType.Add(customAttribute.ArmorModelSlot, type2); } }
static ClassToArmorModelSlot() { List <Type> types = new List <Type>(); Type[] typeArray = typeof(ArmorModelSlotUtility.ClassToArmorModelSlot).Assembly.GetTypes(); for (int i = 0; i < (int)typeArray.Length; i++) { Type type = typeArray[i]; if (type.IsSubclassOf(typeof(ArmorModel)) && !type.IsAbstract && type.IsDefined(typeof(ArmorModelSlotClassAttribute), false)) { types.Add(type); } } ArmorModelSlotUtility.ClassToArmorModelSlot.ArmorModelSlotToType = new Dictionary <ArmorModelSlot, Type>(types.Count); foreach (Type type1 in types) { ArmorModelSlotClassAttribute customAttribute = (ArmorModelSlotClassAttribute)Attribute.GetCustomAttribute(type1, typeof(ArmorModelSlotClassAttribute)); ArmorModelSlotUtility.ClassToArmorModelSlot.ArmorModelSlotToType.Add(customAttribute.ArmorModelSlot, type1); } }