public static BldgProtoDef Create <TProto, TDef>() where TDef : BldgDefG <TDef> { var def = new BldgProtoDef(TypeDef.Create <TProto>(), TypeDef.Create <TDef>()); BldgDefG <TDef> .SetProto(def); return(def); }