indexing description: "This denotes a special kind of puzzle_view. Parts in this view only disappear, when they are locked.." author: "Stefan Hildenbrand and Team UC" date: "$Date$" revision: "$Revision$" class UC_FROM_SPACE inherit UC_WORKSPACE redefine cond_delete end EM_SHARED_BITMAP_FACTORY export {NONE} all undefine copy, is_equal end create make_from_puzzle feature -- Element change cond_delete(v: EM_DRAWABLE) is -- redefine delete to handle the case where we want to delete -- the hidden element (which will most likely happen very often) -- IMPORTANT: this does not delete the part_view if it is not locked yet! -- instead it makes a copy of the part to delete and keeps the copy ! local part_view : UC_PUZZLE_PART_VIEW do part_view ?= v -- cast v if (not part_view.puzzle_part.locked and part_view = hidden_part) then -- we would like to copy a part we hide before -- so just put a copy where the part came from -- and forget about hiding replace (clone(hidden_part), hidden_index) hidden_part := void -- if the part is not locked an we don't hide it either, -- just do nothing ! else -- the part is solved, we can remove it if v = hidden_part then -- we hide the part before -- just remove this one remove (hidden_index) hidden_part := void -- and forget that we hide it else -- we want to remove a part which is not in hide -- or something which is not a part_view at all -- so call precursor Precursor (v) end end end end -- class UC_FROM_SPACE