Skip to content

Commit

Permalink
Remove unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pusewicz committed May 7, 2024
1 parent 6c01a73 commit 5d5e9af
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/wave_function_collapse/cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@ def tile
end

def collapse
return if @tiles.nil?

self.tiles = [@tiles.max_by { |t| rand**(1.0 / t.probability) }]
end

def neighbors(model)
return if model.nil?

@neighbors[model.width * y + x] ||= begin
up = model.cell_at(@x, @y + 1) if @y < model.height - 1
down = model.cell_at(@x, @y - 1) if @y.positive?
Expand Down

0 comments on commit 5d5e9af

Please sign in to comment.