indexing description: "[ create rectangle command. ]" date: "$Date$" revision: "$Revision$" class CREATE_RECTANGLE inherit COMMAND create make feature -- Initialization make is -- creation procedure. do end feature {HISTORY} -- Access execute (args: TUPLE) is -- create circle (it is already added to object_list) -- args.item (1) :: object_list: DS_LINKED_LIST [OBJECT] -- args.item (2) :: rectangle: RECTANGLE -- circle is already created! do execute_successful := False if args.count = 2 then object_list ?= args.item (1) rectangle ?= args.item (2) if object_list /= Void and rectangle /= Void then rectangle.set_new_true_size (rectangle.point_a, rectangle.point_b) create point_a.make_from_other (rectangle.true_point_a) create point_b.make_from_other (rectangle.true_point_b) rectangle.recreate_collidable execute_successful := True else execute_successful := False if rectangle /= Void then rectangle.prepare_deletion end end end end undo (args: TUPLE) is -- Undo command require else object_list_not_void: object_list /= Void rectangle_not_void: rectangle /= Void do rectangle.prepare_deletion object_list.delete (rectangle) execute_successful := False undo_successful := True redo_successful := False end redo (args: TUPLE) is -- Redo command require else object_list_not_void: object_list /= Void rectangle_not_void: rectangle /= Void do rectangle.make_obj_notcreate (point_a, point_b) rectangle.recreate_collidable object_list.force_last (rectangle) execute_successful := False undo_successful := False redo_successful := True end name: STRING is "create rectangle" -- The nama of the current command feature -- Implementation object_list: DS_LINKED_LIST [OBJECT] -- reference to `objects' point_a, point_b: EM_VECTOR_2D -- backup of position rectangle: RECTANGLE -- reference to the circle end