indexing description: "[ An object (polygon, rectangle or circle) ]" date: "$Date$" revision: "$Revision$" deferred class OBJECT feature -- Access collidable: EM_COLLIDABLE is -- Returns the equivalent collidable of the current object -- if none could be created (in case of non-convex polygons for example) -- Void is returned. deferred end is_selected: BOOLEAN -- is the current object selected? is_valid: BOOLEAN is -- is this object valid? do Result := True end scene: SCENE -- the scene on which this object is true_x, true_y: DOUBLE -- the true value of the center x, y: INTEGER is -- `x' and `y' deferred end vertex_list: DS_LINKED_LIST [VERTEX] is -- a list of vertexes that the object has deferred end feature -- Element Change set_true_x_y (an_x, a_y: DOUBLE) is -- sets `true_x' and `true_y' do true_x := an_x true_y := a_y set_x_y (an_x.rounded, a_y.rounded) end set_x_y (an_x, an_y: INTEGER) is -- sets `x' and `y' deferred end set_selected (b: BOOLEAN) is -- sets `is_selected' do is_selected := b ensure is_selected_set: is_selected = b end set_changed is -- generate `collidable' and recompute vertexes deferred end set_vertexes_updated is -- vertexes have been updated deferred end prepare_deletion is -- prepare for deletion do -- remove from collision detector scene.collision_detector.remove (current) end move_by (an_x, a_y: DOUBLE) is -- sets `x' and `y' (an_x and a_y are screen positions!) deferred end add_collidable_to_scene is -- adds `collidable' to the collision detector do scene.collision_detector.add (current) end recreate_collidable is -- creacreate `collidable'. deferred end invariant scene_not_void: scene /= Void end