Skip to content

Commit

Permalink
Implement == for faster delete comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
pusewicz committed May 7, 2024
1 parent ff360d7 commit 3bec153
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/wave_function_collapse/cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def initialize(x, y, tiles)
@y = y
end

def ==(other)
@x == other.x && @y == other.y
end

def tiles=(new_tiles)
@tiles = new_tiles
update
Expand Down

0 comments on commit 3bec153

Please sign in to comment.