# pathfind.h File Reference

`#include "direction_type.h"`

Go to the source code of this file.

## Data Structures

struct | TrackPathFinderLink
struct | RememberData
struct | TrackPathFinder

## Defines

#define | PATHFIND_GET_LINK_OFFS(tpf, link) ((byte*)(link) - (byte*)tpf->links)
#define | PATHFIND_GET_LINK_PTR(tpf, link_offs) (TrackPathFinderLink*)((byte*)tpf->links + (link_offs))
#define | PATHFIND_HASH_TILE(tile) (TileX(tile) & 0x1F) + ((TileY(tile) & 0x1F) << 5)

## Typedefs

typedef bool | TPFEnumProc (TileIndex tile, void *data, Trackdir trackdir, uint length)
typedef void | TPFAfterProc (TrackPathFinder *tpf)
typedef bool | NTPEnumProc (TileIndex tile, void *data, int track, uint length)

## Enumerations

enum | { STR_FACTOR = 2, DIAG_FACTOR = 3 }

## Functions

void | FollowTrack (TileIndex tile, uint16 flags, uint sub_type, DiagDirection direction, TPFEnumProc *enum_proc, TPFAfterProc *after_proc, void *data)
void | NewTrainPathfind (TileIndex tile, TileIndex dest, RailTypes railtypes, DiagDirection direction, NTPEnumProc *enum_proc, void *data)
| new pathfinder for trains.

## Detailed Description

Definition in file pathfind.h.

## Function Documentation

void NewTrainPathfind | ( | TileIndex | tile,
|  | TileIndex | dest,
|  | RailTypes | railtypes,
|  | DiagDirection | direction,
|  | NTPEnumProc * | enum_proc,
|  | void * | data |
| ) |  |  |

new pathfinder for trains.

better and faster.

Definition at line 821 of file pathfind.cpp.

References min().

Referenced by FindClosestTrainDepot().