10#ifndef STATION_KDTREE_H
11#define STATION_KDTREE_H
18 inline uint16_t operator()(StationID stid,
int dim)
25extern StationKdtree _station_kdtree;
33template <
typename Func>
36 uint16_t x1, y1, x2, y2;
37 x1 = (uint16_t)std::max<int>(0,
TileX(center) - radius);
39 y1 = (uint16_t)std::max<int>(0,
TileY(center) - radius);
42 _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 uint TileY(TileIndex tile)
Get the Y component of a tile.
static 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 SizeX()
Get the size of the map along the X.
static uint SizeY()
Get the size of the map along the Y.
static BaseStation * Get(auto index)
static Station * Get(auto index)
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.