extends Tile var style_box: StyleBoxFlat var walls: Array[Board.Direction] = [] func _ready() -> void: style_box = get_theme_stylebox("panel") func set_wall(direction: Board.Direction) -> void: walls = [direction] match direction: Board.Direction.NONE: walls = [] style_box.border_width_top = 0 style_box.border_width_bottom = 0 style_box.border_width_right = 0 style_box.border_width_left = 0 Board.Direction.UP: style_box.border_width_top = 10 style_box.border_width_bottom = 0 style_box.border_width_right = 0 style_box.border_width_left = 0 Board.Direction.DOWN: style_box.border_width_top = 0 style_box.border_width_bottom = 10 style_box.border_width_right = 0 style_box.border_width_left = 0 Board.Direction.RIGHT: style_box.border_width_top = 0 style_box.border_width_bottom = 0 style_box.border_width_right = 10 style_box.border_width_left = 0 Board.Direction.LEFT: style_box.border_width_top = 0 style_box.border_width_bottom = 0 style_box.border_width_right = 0 style_box.border_width_left = 10 func add_wall(direction: Board.Direction) -> void: if !walls.has(direction): walls.push_back(direction) match direction: Board.Direction.UP: style_box.border_width_top = 10 Board.Direction.DOWN: style_box.border_width_bottom = 10 Board.Direction.RIGHT: style_box.border_width_right = 10 Board.Direction.LEFT: style_box.border_width_left = 10