Example #1
0
 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]);
 }
Example #2
0
 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]);
 }
Example #3
0
 private static MemberInfo ForValue(SocketItemVars v)
 {
     return(typeof(SocketItemVars).GetField(Enum.GetName(typeof(SocketItemVars), v)));
 }
Example #4
0
 private static SocketItemVarsAttribute GetAttr(SocketItemVars v)
 {
     return((SocketItemVarsAttribute)Attribute.GetCustomAttribute(ForValue(v), typeof(SocketItemVarsAttribute)));
 }