Module: RDGC::Maker::DungeonMaker
- Included in:
- DivideDungeonMaker
- Defined in:
- lib/rdgc/maker/dungeon_maker.rb
Instance Method Summary collapse
- #blocks ⇒ Object
- #clear_block ⇒ Object
- #create_pure_blocks ⇒ Object
- #create_road ⇒ Object
- #create_room ⇒ Object
- #create_whole_block(width, height) ⇒ Object
- #make(width, height, params = nil) ⇒ Object
- #make_blocks(tb) ⇒ Object
- #params ⇒ Object
Instance Method Details
#blocks ⇒ Object
22 23 24 25 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 22 def blocks @blocks ||= [] @blocks end |
#clear_block ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 39 def clear_block return if blocks.size <= 1 blocks.each do |b| next if b.has_road? b.remove_all end end |
#create_pure_blocks ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 47 def create_pure_blocks blocks.inject([]) do |l, b| pb = b.create_pure_block l << pb if pb l end end |
#create_road ⇒ Object
36 37 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 36 def create_road end |
#create_room ⇒ Object
33 34 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 33 def create_room end |
#create_whole_block(width, height) ⇒ Object
27 28 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 27 def create_whole_block(width, height) end |
#make(width, height, params = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 6 def make(width, height, params = nil) @params = params tb = create_whole_block(width, height) @blocks = make_blocks(tb) @blocks.freeze create_room create_road clear_block create_pure_blocks end |
#make_blocks(tb) ⇒ Object
30 31 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 30 def make_blocks(tb) end |
#params ⇒ Object
17 18 19 20 |
# File 'lib/rdgc/maker/dungeon_maker.rb', line 17 def params @params ||= {} @params end |