2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file town_kdtree.h Declarations for accessing the k-d tree of towns */
13 #include "core/kdtree.hpp"
16 struct Kdtree_TownXYFunc
{
17 inline uint16_t operator()(TownID tid
, int dim
)
19 return (dim
== 0) ? TileX(Town::Get(tid
)->xy
) : TileY(Town::Get(tid
)->xy
);
23 using TownKdtree
= Kdtree
<TownID
, Kdtree_TownXYFunc
, uint16_t, int>;
24 extern TownKdtree _town_kdtree
;
25 extern TownKdtree _town_local_authority_kdtree
;