ruby: add MapTile#burrow

develop
jj 2013-03-30 20:22:25 +01:00
parent 3567bb7299
commit 135289e89a
1 changed files with 15 additions and 1 deletions

@ -149,7 +149,21 @@ module DFHack
def vein
# last vein wins
all_veins.reverse.find { |v|
(v.tile_bitmask.bits[@dy] & (1 << @dx)) > 0
v.tile_bitmask.bits[@dy][@dx] > 0
}
end
# return the first BlockBurrow this tile is in (nil if none)
def burrow
mapblock.block_burrows.find { |b|
b.tile_bitmask.bits[@dy][@dx] > 0
}
end
# return the array of BlockBurrow this tile is in
def all_burrows
mapblock.block_burrows.find_all { |b|
b.tile_bitmask.bits[@dy][@dx] > 0
}
end