From 905f1d96b3e68037883f4d25baddcfb25884adf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 21 Jul 2020 09:47:44 +0200 Subject: shorten HexMap.adjacents_of() --- HexMap.gd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HexMap.gd b/HexMap.gd index e73a34a..c719b20 100644 --- a/HexMap.gd +++ b/HexMap.gd @@ -138,9 +138,8 @@ func _key(x : int, y : int) -> int: # build the 6 adjacent Tiles of a Tile given by it's col;row coordinates func adjacents_of(tile : Tile, tiles : Array) -> void: - _build_adjacents(tile.coords) tiles.clear() - for t in adjacents: tiles.append(t) + for t in _build_adjacents(tile.coords): tiles.append(t) func _build_adjacents(coords : Vector2) -> Array: adjacents.clear() -- cgit v1.1-2-g2b99