public static VariableType GetVariableType(this SocketItemVars v) { if (!typeMap.ContainsKey(v)) { Log.LogError(v, string.Concat("Socket item var `", v, "` has no type")); throw new Exception(string.Concat("Socket item var `", v, "` has no type")); } return(typeMap[v]); }
public static string GetKey(this SocketItemVars v) { if (!keyMap.ContainsKey(v)) { Log.LogError(v, string.Concat("Socket item var `", v, "` has no key")); throw new Exception(string.Concat("Socket item var `", v, "` has no key")); } return(keyMap[v]); }
private static MemberInfo ForValue(SocketItemVars v) { return(typeof(SocketItemVars).GetField(Enum.GetName(typeof(SocketItemVars), v))); }
private static SocketItemVarsAttribute GetAttr(SocketItemVars v) { return((SocketItemVarsAttribute)Attribute.GetCustomAttribute(ForValue(v), typeof(SocketItemVarsAttribute))); }