-- Trees block the Stooge's bullets but not Medusa's glare.

deferred class PUZZLE_TREE
-- Cannot use TREE as conflict with library class name.

inherit

  SESSILE
  redefine
    restart, build_record, customized_init
  end

feature -- save/restore

  build_record is
  do
    precursor
    if vanished then
      record.extend( 0 )
    else
     record.extend( 1 )
    end

  ensure then
    proper_num_rec:  record.count > 3
  end

feature{NONE} -- save/restore

  customized_init( r : like room ; pr : like record ) is
  do
    precursor( r, pr )

    pr.forth
    if pr.item = 0 then
      vanished := True
      display_vacate
    else 
      vanished := False
      occupy( northwest )
    end
  end

feature

  blocks_glare : BOOLEAN is False
  blocks_shots : BOOLEAN is True

  vanished : BOOLEAN

  restart is
  do
    precursor
    vanished := False
  ensure then
    not vanished
  end

  chop is
  -- Chop me down
  do
    vacate
    vanished := True
  end

end 
