From 3bec15386193f76af49c185e5c55e5e2f05a1432 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Tue, 7 May 2024 06:13:10 +0200 Subject: [PATCH] Implement == for faster delete comparison --- lib/wave_function_collapse/cell.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/wave_function_collapse/cell.rb b/lib/wave_function_collapse/cell.rb index 20c6d51..1e39b4d 100644 --- a/lib/wave_function_collapse/cell.rb +++ b/lib/wave_function_collapse/cell.rb @@ -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