Module: RDGC::Maker::DungeonMaker

Included in:
DivideDungeonMaker
Defined in:
lib/rdgc/maker/dungeon_maker.rb

Instance Method Summary collapse

Instance Method Details

#blocksObject



22
23
24
25
# File 'lib/rdgc/maker/dungeon_maker.rb', line 22

def blocks
  @blocks ||= []
  @blocks
end

#clear_blockObject



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_blocksObject



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_roadObject



36
37
# File 'lib/rdgc/maker/dungeon_maker.rb', line 36

def create_road
end

#create_roomObject



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

#paramsObject



17
18
19
20
# File 'lib/rdgc/maker/dungeon_maker.rb', line 17

def params
  @params ||= {}
  @params
end