From c4cb9637f5c85d03aa162968f0dfec3c193fc9dc Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 20 Jan 2023 03:18:06 +0100 Subject: intermediate commit Implement actions and multiple ui widgets --- go/game/range.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'go/game/range.go') diff --git a/go/game/range.go b/go/game/range.go index 86ec2f50..e12e1e67 100644 --- a/go/game/range.go +++ b/go/game/range.go @@ -37,3 +37,11 @@ func PositionsInRange(origin Position, r int, includeOrigin bool) []Position { } return positions } + +func TilesInRange(m *Map, p Permanent, r int) []*Tile { + tiles := []*Tile{} + for _, pos := range PositionsInRange(p.GetTile().Position, r, false) { + tiles = append(tiles, m.TileAt(pos)) + } + return tiles +} -- cgit v1.2.3