75 /* These functions below are _not_ re-entrant, in favor of speed! */ |
76 /* These functions below are _not_ re-entrant, in favor of speed! */ |
76 |
77 |
77 /* Will search from the given tile and direction, for a route to the given |
78 /* Will search from the given tile and direction, for a route to the given |
78 * station for the given transport type. See the declaration of |
79 * station for the given transport type. See the declaration of |
79 * NPFFoundTargetData above for the meaning of the result. */ |
80 * NPFFoundTargetData above for the meaning of the result. */ |
80 NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes); |
81 NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes); |
81 |
82 |
82 /* Will search as above, but with two start nodes, the second being the |
83 /* Will search as above, but with two start nodes, the second being the |
83 * reverse. Look at the NPF_FLAG_REVERSE flag in the result node to see which |
84 * reverse. Look at the NPF_FLAG_REVERSE flag in the result node to see which |
84 * direction was taken (NPFGetBit(result.node, NPF_FLAG_REVERSE)) */ |
85 * direction was taken (NPFGetBit(result.node, NPF_FLAG_REVERSE)) */ |
85 NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes); |
86 NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes); |
86 |
87 |
87 /* Will search a route to the closest depot. */ |
88 /* Will search a route to the closest depot. */ |
88 |
89 |
89 /* Search using breadth first. Good for little track choice and inaccurate |
90 /* Search using breadth first. Good for little track choice and inaccurate |
90 * heuristic, such as railway/road.*/ |
91 * heuristic, such as railway/road.*/ |
91 NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes); |
92 NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypes railtypes); |
92 /* Same as above but with two start nodes, the second being the reverse. Call |
93 /* Same as above but with two start nodes, the second being the reverse. Call |
93 * NPFGetBit(result.node, NPF_FLAG_REVERSE) to see from which node the path |
94 * NPFGetBit(result.node, NPF_FLAG_REVERSE) to see from which node the path |
94 * orginated. All pathfs from the second node will have the given |
95 * orginated. All pathfs from the second node will have the given |
95 * reverse_penalty applied (NPF_TILE_LENGTH is the equivalent of one full |
96 * reverse_penalty applied (NPF_TILE_LENGTH is the equivalent of one full |
96 * tile). |
97 * tile). |
97 */ |
98 */ |
98 NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes, uint reverse_penalty); |
99 NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, uint sub_type, Owner owner, RailTypes railtypes, uint reverse_penalty); |
99 /* Search by trying each depot in order of Manhattan Distance. Good for lots |
100 /* Search by trying each depot in order of Manhattan Distance. Good for lots |
100 * of choices and accurate heuristics, such as water. */ |
101 * of choices and accurate heuristics, such as water. */ |
101 NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes); |
102 NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypes railtypes); |
102 |
103 |
103 void NPFFillWithOrderData(NPFFindStationOrTileData* fstd, Vehicle* v); |
104 void NPFFillWithOrderData(NPFFindStationOrTileData* fstd, Vehicle* v); |
104 |
105 |
105 |
106 |
106 /* |
107 /* |