Rectangle add(Rectangle& r2) { int xend = x + w, yend = y + h; int xend2 = r2.x + r2.w, yend2 = r2.y + r2.h; Rectangle r; r.x = x < r2.x ? x : r2.x; r.y = y < r2.y ? y : r2.y; r.w = (xend > xend2 ? xend : xend2) - r.x; r.h = (yend > yend2 ? yend : yend2) - r.y; return (r); }
void add(Game_object *obj) { objects.append(obj); }
	Rectangle add(Rectangle& r2)	// Add another to this one to get		{			//  a rect. that encloses both.		int xend = x + w, yend = y + h;		int xend2 = r2.x + r2.w, yend2 = r2.y + r2.h;		Rectangle r;		// Return this.		r.x = x < r2.x ? x : r2.x;		r.y = y < r2.y ? y : r2.y;		r.w = (xend > xend2 ? xend : xend2) - r.x;		r.h = (yend > yend2 ? yend : yend2) - r.y;		return (r);		}