public SpellStatBlock_Combat(SpellStatBlock SB) { Type type = SB.GetType(); type = type.BaseType; UpdateForType(type, SB, this); }
private static void UpdateForType(Type type, SpellStatBlock source, SpellStatBlock_Combat destination) { FieldInfo[] myObjectFields = type.GetFields( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); foreach (FieldInfo fi in myObjectFields) { fi.SetValue(destination, fi.GetValue(source)); } }