public static Thing GetAttachment(this Thing t, ThingDef def)
        {
            CompAttachBase compAttachBase = t.TryGetComp <CompAttachBase>();

            if (compAttachBase == null)
            {
                return(null);
            }
            return(compAttachBase.GetAttachment(def));
        }
        public static Thing GetAttachment(this Thing t, ThingDef def)
        {
            CompAttachBase compAttachBase = t.TryGetComp <CompAttachBase>();
            Thing          result;

            if (compAttachBase == null)
            {
                result = null;
            }
            else
            {
                result = compAttachBase.GetAttachment(def);
            }
            return(result);
        }