diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-20 03:18:06 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:44 +0100 |
| commit | c4cb9637f5c85d03aa162968f0dfec3c193fc9dc (patch) | |
| tree | 3ad32e5dfd7c4ae72f66b86e77edef7b700a8b7a /go/game/range.go | |
| parent | 9df5cc7b55d8ac9ecd775a14a14f80a6c36c4d74 (diff) | |
| download | muhqs-game-c4cb9637f5c85d03aa162968f0dfec3c193fc9dc.tar.gz muhqs-game-c4cb9637f5c85d03aa162968f0dfec3c193fc9dc.zip | |
intermediate commit
Implement actions and multiple ui widgets
Diffstat (limited to 'go/game/range.go')
| -rw-r--r-- | go/game/range.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 +} |
