summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-21 09:47:44 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-21 09:47:44 +0200
commit905f1d96b3e68037883f4d25baddcfb25884adf0 (patch)
tree9490b626ac1f0b29a0f0478f30e419b259b0964e
parentaed4de134cae45ecae743d2f8848396267ebc2ac (diff)
downloadgodot-hexgrid-905f1d96b3e68037883f4d25baddcfb25884adf0.zip
godot-hexgrid-905f1d96b3e68037883f4d25baddcfb25884adf0.tar.gz
shorten HexMap.adjacents_of()
-rw-r--r--HexMap.gd3
1 files changed, 1 insertions, 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()