Method: IFMWriter#sections

Defined in:
lib/IFMapper/IFMWriter.rb

#sectionsObject



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/IFMapper/IFMWriter.rb', line 195

def sections
  old_section = @map.section
  @map.sections.each_with_index { |section, idx|
    @f.puts
    @f.puts '#' * 79
    @f.puts
    if section.name.to_s == ''
	if @map.sections.size > 1
 @f.puts "map \"Section #{idx+1}\";"
	end
    else
	@f.puts "map \"#{section.name}\";"
    end
    @map.section = idx
    @link = []
    section.rooms.each { |r|
	room(r)
	@link << 'nolink'
    }
    section.connections.each { |c|
	link(c)
    }
  }
  @map.section = old_section
end