indexing description: "[ A recangular EM_GOOF_AREA. ]" date: "$Date$" revision: "$Revision$" class EM_GOOF_RECT_AREA inherit EM_GOOF_AREA create make feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Initialization make(a_position, a_dilatation: EM_VECTOR_2D) is -- Make rect_area require a_position_not_void: a_position /= void a_dilatation_not_void: a_dilatation /= void do position := a_position dilatation := a_dilatation ensure position_set: position = a_position dilatation_set: dilatation = a_dilatation end feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Properties position: EM_VECTOR_2D -- Position (top/left) set_position(a_position: EM_VECTOR_2D) is -- Set position require a_position_not_void: a_position /= void do position := a_position ensure position_set: position = a_position end dilatation: EM_VECTOR_2D -- Rect_areas dilatation (width/height) set_dilatation(a_dilatation: EM_VECTOR_2D) is -- Set dilatation require a_dilatation_not_void: a_dilatation /= void do dilatation := a_dilatation ensure dilatation_set: dilatation = a_dilatation end feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Status is_in_area(point: EM_VECTOR_2D): BOOLEAN is -- Is 'point' in the area? do result := point.x > position.x and point.x < position.x + dilatation.x and point.y > position.y and point.y < position.y + dilatation.y end invariant dilatation_not_void: dilatation /= void position_not_void: position /= void end