indexing description: "[ Command for creating polygons. ]" date: "$Date$" revision: "$Revision$" class CREATE_POLYGON inherit COMMAND create make feature -- Initialization make is -- creation procedure. do end feature {HISTORY} -- Access execute (args: TUPLE) is -- create polygon (it is already added to object_list) -- args.item (1) :: object_list: DS_LINKED_LIST [OBJECT] -- args.item (2) :: polygon: POLYGON -- polygon is already created! do execute_successful := False if args.count = 2 then object_list ?= args.item (1) polygon ?= args.item (2) if object_list /= Void and polygon /= Void then polygon.set_true_x_y (polygon.x, polygon.y) polygon.recreate_collidable execute_successful := True else execute_successful := False if polygon /= Void then polygon.prepare_deletion end end end end undo (args: TUPLE) is -- Undo command require else object_list_not_void: object_list /= Void polygon_not_void: polygon /= Void do polygon.prepare_deletion object_list.delete (polygon) 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 polygon_not_void: polygon /= Void do polygon.add_collidable_to_scene polygon.recreate_collidable object_list.force_last (polygon) execute_successful := False undo_successful := False redo_successful := True end name: STRING is "create polygon" -- The name of the current command feature -- Implementation object_list: DS_LINKED_LIST [OBJECT] -- reference to `polygons' polygon: POLYGON -- reference to the polygon end