Constructor
new TileSearcher()
Methods
search(view, tile, result) → {number}
Performs a search for visible tiles by starting at a given tile and recursively exploring neighbors until no more visible tiles are found.
Parameters:
Name | Type | Description |
---|---|---|
view |
View | The view used to deem whether a tile is visible. |
tile |
Tile | The starting tile. |
result |
Array.<Tile> | An array to append the visible tiles to, including the starting tile when visible. Existing array members are preserved. |
Returns:
The number of visible tiles found.
- Type
- number