public static int GetUpdateField(CorpseField corpseField) { var typeString = string.Format("WowPacketParser.Enums.Version.{0}.CorpseField", ClientVersion.GetVersionString()); var newEnumType = _assembly.GetType(typeString); foreach (int val in Enum.GetValues(newEnumType)) { if (Enum.GetName(newEnumType, val) == corpseField.ToString()) { return(val); } } return((int)corpseField); }
public static int GetUpdateField(CorpseField corpseField) { var typeString = string.Format("WowPacketParser.Enums.Version.{0}.CorpseField", ClientVersion.GetVersionString()); var newEnumType = _assembly.GetType(typeString); foreach (int val in Enum.GetValues(newEnumType)) if (Enum.GetName(newEnumType, val) == corpseField.ToString()) return val; return (int)corpseField; }