10 #ifndef STATION_KDTREE_H
11 #define STATION_KDTREE_H
28 template <
typename Func>
31 uint16_t x1, y1, x2, y2;
32 x1 = (uint16_t)std::max<int>(0,
TileX(center) - radius);
34 y1 = (uint16_t)std::max<int>(0,
TileY(center) - radius);
37 _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.
Base class for all station-ish types.
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.