Class: RDGC::Maker::TempBlock

Inherits:
RDGC::Map::Block show all
Defined in:
lib/rdgc/maker/temp_block.rb

Direct Known Subclasses

DivideTempBlock

Constant Summary

Constants included from RDGC::Map::TileType

RDGC::Map::TileType::OUT, RDGC::Map::TileType::ROAD, RDGC::Map::TileType::ROOM, RDGC::Map::TileType::WALL

Instance Attribute Summary

Attributes inherited from RDGC::Map::Area

#bottom, #left, #right, #top

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RDGC::Map::Block

#add_road, #cling_direction_to, #cling_to_bottom?, #cling_to_left?, #cling_to_right?, #cling_to_top?, create, #create_cross_point, #create_room, #cross_point, #empty?, #fill, #fill_roads, #fill_room, #has_cross_point?, #has_road?, #has_room?, #remove_all, #remove_cross_point, #remove_roads, #remove_room, #roads, #room, #room=

Methods inherited from RDGC::Map::Area

#blind_level, #blind_level_blind?, #blind_level_dark?, #blind_level_none?, #blind_level_open?, #coordinates, create, #each, #each_tile, #each_x, #each_y, #fill, #fill_tile, #has_xy?, #height, #random_point, #set_blind, #set_tile, #tile, #width

Class Method Details

.create_whole_block(width, height) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rdgc/maker/temp_block.rb', line 6

def self.create_whole_block(width, height)
  left = 0
  right = width - 1
  top = 0
  bottom = height - 1
  self.create(top, bottom, left, right)
end

Instance Method Details

#create_pure_blockObject



14
15
16
17
18
19
# File 'lib/rdgc/maker/temp_block.rb', line 14

def create_pure_block
  b = Map::Block.create(self.top, self.bottom, self.left, self.right)
  b.room = self.room if self.has_room?
  self.roads.each{|r| b.add_road(r) if r}
  b.empty? ? nil : b
end