indexing description: "[ An EM_GOOF_FORCE that applies between every two EM_GOOF_PHYSICABLE. ]" date: "$Date$" revision: "$Revision$" deferred class EM_GOOF_BINARY_FORCE inherit EM_GOOF_FORCE feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Processing process(objects: DS_LINKED_LIST[EM_GOOF_OBJECT]) is -- Apply force to all physicables -- Every force is applied to every possible pair of physicable objects local cursor1,cursor2: DS_LINKED_LIST_CURSOR[EM_GOOF_OBJECT] physical_object_1,physical_object_2: EM_GOOF_PHYSICABLE do from cursor1 := objects.new_cursor cursor1.start until cursor1.after loop physical_object_1 ?= cursor1.item if physical_object_1 /= void then from cursor2 := objects.new_cursor cursor2.start until cursor2.after loop physical_object_2 ?= cursor2.item if physical_object_2 /= void then if physical_object_1 /= physical_object_2 then process_objects(physical_object_1,physical_object_2) end end cursor2.forth end end cursor1.forth end end process_objects(object1,object2: EM_GOOF_PHYSICABLE) is -- apply the force to this object require object_1_not_void: object1 /= void object_2_not_void: object2 /= void deferred end end