mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
* Fixing armor coverage in slots inventory * Refactor * cleaning up imports * EquipMask -> ValidLocations for clarity * update msg * cleaning up werrors * more cleanup + comments
13 lines
458 B
C#
13 lines
458 B
C#
namespace ACE.Entity.Enum
|
|
{
|
|
public static class AttributeExtensions
|
|
{
|
|
public static T GetAttributeOfType<T>(this System.Enum enumVal) where T : System.Attribute
|
|
{
|
|
var type = enumVal.GetType();
|
|
var memInfo = type.GetMember(enumVal.ToString());
|
|
var attributes = memInfo[0].GetCustomAttributes(typeof(T), false);
|
|
return (attributes.Length > 0) ? (T)attributes[0] : null;
|
|
}
|
|
}
|
|
}
|