public static GrowthStandartWear? GetGrowthStandart(СlothesType wearCategory, ClothesSex sex) { var att = wearCategory.GetAttribute<NeedGrowthAttribute> (); if (att == null) return null; if (sex == ClothesSex.Women) return GrowthStandartWear.Women; if (sex == ClothesSex.Men) return GrowthStandartWear.Men; if (sex == ClothesSex.Universal) return GrowthStandartWear.Universal; return null; }
public static Type GetSizeStandartsEnum(СlothesType wearCategory, ClothesSex sex) { var att = wearCategory.GetAttributes<SizeStandartsAttribute> (); if (att.Length == 0) return null; var found = att.FirstOrDefault (a => a.Sex == sex); return found != null ? found.StandartsEnumType : null; }
public SizeStandartsAttribute(Type enumStd, ClothesSex sex, SizeUse use = SizeUse.Both) { StandartsEnumType = enumStd; Sex = sex; Use = use; }