indexing description: "[ Command for creating circles. ]" date: "$Date$" revision: "$Revision$" class CREATE_CIRCLE 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) :: circle: CIRCLE -- circle is already created! do execute_successful := False if args.count = 2 then object_list ?= args.item (1) circle ?= args.item (2) if object_list /= Void and circle /= Void then create center.make (circle.center.x, circle.center.y) radius := circle.radius circle.set_true_radius (radius) circle.set_changed circle.recreate_collidable execute_successful := True else execute_successful := False if circle /= Void then circle.prepare_deletion end end end end undo (args: TUPLE) is -- Undo command require else object_list_not_void: object_list /= Void circle_not_void: circle /= Void do circle.prepare_deletion object_list.delete (circle) 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 circle_not_void: circle /= Void do circle.make_obj (circle.center, circle.radius, circle.scene) object_list.force_last (circle) circle.recreate_collidable execute_successful := False undo_successful := False redo_successful := True end name: STRING is "create circle" -- The nama of the current command feature -- Implementation object_list: DS_LINKED_LIST [OBJECT] -- reference to `objects' radius: DOUBLE -- radius center: EM_VECTOR_2D -- center circle: CIRCLE -- reference to the circle end