Example #1
0
        public static void DumpSTUFields <T>(T instance, string padding = "\t")    // eww?
        {
            Type t = typeof(T);

            foreach (FieldInfo info in t.GetFields())
            {
                object got = info.GetValue(instance);
                if (got == null)
                {
                    Console.Out.WriteLine("{0}{1}: {2:X8}", padding, info.Name, info.GetValue(instance));
                }
                else
                {
                    if (got.GetType().Name == "STUGUID" && got.GetType().Namespace == "STULib.Types.Generic")
                    {
                        ulong key = (ulong)GetInstanceField(got.GetType(), got, "Key");
                        Console.Out.WriteLine($"{padding}{info.Name}: {GUID.LongKey(key):X12}.{GUID.Type(key):X3}");
                    }
                    else
                    {
                        Console.Out.WriteLine("{0}{1}: {2:X8}", padding, info.Name, info.GetValue(instance).ToString());
                    }
                }
            }
        }
Example #2
0
 public static ulong keyToIndexID(ulong key)
 {
     return(GUID.LongKey(key));
 }
Example #3
0
 public static string ToStringA(this OWRecord i)
 {
     return($"{GUID.LongKey(i.key):X12}.{GUID.Type(i.key):X3}");
 }