5 @export var piece_name: String = ""
7 var cells: Array[Cell] = []
8 var block_size: int = 0
10 var cell_grid: Array[Vector2i] = []
12 func _ready() -> void:
13 for c in self.get_children():
17 # all cells must have same block size
20 block_size = c.block_size
22 assert(block_size == c.block_size, "All cells must have same block size")
24 # build cell grid coordinates
26 var pos_x: int = floori(c.position.x / block_size)
27 var pos_y: int = floori(c.position.y / block_size)
28 cell_grid.append(Vector2i(pos_x, pos_y))
31 func _to_string() -> String: