OpenTTD Source: src/station_kdtree.h File Reference

OpenTTD Source 1.11.0-RC1

Typedefs | Functions | Variables
station_kdtree.h File Reference
`#include "core/kdtree.hpp"`
`#include "core/math_func.hpp"`
`#include "station_base.h"`
`#include "map_func.h"`

Go to the source code of this file.

## Typedefs
typedef Kdtree< StationID, decltype(&Kdtree_StationXYFunc), uint16, int > | StationKdtree

## Functions
uint16 | Kdtree_StationXYFunc (StationID stid, int dim)
template<typename Func >
void | ForAllStationsRadius (TileIndex center, uint radius, Func func)
| Call a function on all stations whose sign is within a radius of a center tile. More...

## Variables
StationKdtree | _station_kdtree

## Detailed Description

Declarations for accessing the k-d tree of stations

Definition in file station_kdtree.h.

## Function Documentation

## ◆ ForAllStationsRadius()

template<typename Func >

void ForAllStationsRadius | ( | TileIndex | center,
|  | uint | radius,
|  | Func | func
| ) |  |

Call a function on all stations whose sign is within a radius of a center tile.

Parameters

  center | Central tile to search around.
  radius | Distance in both X and Y to search within.
  func | The function to call, must take a single parameter which is Station*.

Definition at line 29 of file station_kdtree.h.

Referenced by GetClosestDeletedStation().