10#ifndef STATION_KDTREE_H
11#define STATION_KDTREE_H
19 inline uint16_t operator()(StationID stid,
int dim)
34template <
typename Func>
37 uint16_t x1, y1, x2, y2;
38 x1 = (uint16_t)std::max<int>(0,
TileX(center) - radius);
40 y1 = (uint16_t)std::max<int>(0,
TileY(center) - radius);
43 _station_kdtree.
FindContained(x1, y1, x2, y2, [&](StationID
id) {
K-dimensional tree, specialised for 2-dimensional space.
void FindContained(CoordT x1, CoordT y1, CoordT x2, CoordT y2, const Outputter &outputter) const
Find all items contained within the given rectangle.
K-d tree template specialised for 2-dimensional Manhattan geometry.
Functions related to maps.
static debug_inline uint TileY(TileIndex tile)
Get the Y component of a tile.
static debug_inline uint TileX(TileIndex tile)
Get the X component of a tile.
Base classes/functions for stations.
void ForAllStationsRadius(TileIndex center, uint radius, Func func)
Call a function on all stations whose sign is within a radius of a center tile.
static uint SizeY()
Get the size of the map along the Y.
static debug_inline uint SizeX()
Get the size of the map along the X.
static Titem * Get(size_t index)
Returns Titem with given index.
static Station * Get(size_t index)
Gets station with given index.