comparison src/npf.h @ 9806:a8cc8e4fb3a0 draft

(svn r13948) -Add [YAPP]: Extend NPF with a function to find a safe tile and reserve a path. (michi_cc)
author rubidium <rubidium@openttd.org>
date Sat, 02 Aug 2008 22:52:50 +0000
parents a9cb777d40b5
children 39cf8eebfda5
comparison
equal deleted inserted replaced
9805:a9cb777d40b5 9806:a8cc8e4fb3a0
70 NPF_FLAG_3RD_SIGNAL, ///< Used to mark that three signals were seen, rail only 70 NPF_FLAG_3RD_SIGNAL, ///< Used to mark that three signals were seen, rail only
71 NPF_FLAG_REVERSE, ///< Used to mark that this node was reached from the second start node, if applicable 71 NPF_FLAG_REVERSE, ///< Used to mark that this node was reached from the second start node, if applicable
72 NPF_FLAG_LAST_SIGNAL_RED, ///< Used to mark that the last signal on this path was red 72 NPF_FLAG_LAST_SIGNAL_RED, ///< Used to mark that the last signal on this path was red
73 NPF_FLAG_IGNORE_START_TILE, ///< Used to mark that the start tile is invalid, and searching should start from the second tile on 73 NPF_FLAG_IGNORE_START_TILE, ///< Used to mark that the start tile is invalid, and searching should start from the second tile on
74 NPF_FLAG_TARGET_RESERVED, ///< Used to mark that the possible reservation target is already reserved 74 NPF_FLAG_TARGET_RESERVED, ///< Used to mark that the possible reservation target is already reserved
75 NPF_FLAG_IGNORE_RESERVED, ///< Used to mark that reserved tiles should be considered impassable
75 }; 76 };
76 77
77 /* Meant to be stored in AyStar.userpath */ 78 /* Meant to be stored in AyStar.userpath */
78 struct NPFFoundTargetData { 79 struct NPFFoundTargetData {
79 uint best_bird_dist; ///< The best heuristic found. Is 0 if the target was found 80 uint best_bird_dist; ///< The best heuristic found. Is 0 if the target was found
109 NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, bool ignore_start_tile1, TileIndex tile2, Trackdir trackdir2, bool ignore_start_tile2, TransportType type, uint sub_type, Owner owner, RailTypes railtypes, uint reverse_penalty); 110 NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, bool ignore_start_tile1, TileIndex tile2, Trackdir trackdir2, bool ignore_start_tile2, TransportType type, uint sub_type, Owner owner, RailTypes railtypes, uint reverse_penalty);
110 /* Search by trying each depot in order of Manhattan Distance. Good for lots 111 /* Search by trying each depot in order of Manhattan Distance. Good for lots
111 * of choices and accurate heuristics, such as water. */ 112 * of choices and accurate heuristics, such as water. */
112 NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, bool ignore_start_tile, TransportType type, uint sub_type, Owner owner, RailTypes railtypes); 113 NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, bool ignore_start_tile, TransportType type, uint sub_type, Owner owner, RailTypes railtypes);
113 114
115 /**
116 * Search for any safe tile using a breadth first search and try to reserve a path.
117 */
118 NPFFoundTargetData NPFRouteToSafeTile(const Vehicle *v, TileIndex tile, Trackdir trackdir,bool override_railtype);
119
120
114 void NPFFillWithOrderData(NPFFindStationOrTileData *fstd, Vehicle *v, bool reserve_path = false); 121 void NPFFillWithOrderData(NPFFindStationOrTileData *fstd, Vehicle *v, bool reserve_path = false);
115 122
116 123
117 /* 124 /*
118 * Functions to manipulate the various NPF related flags on an AyStarNode. 125 * Functions to manipulate the various NPF related flags on an AyStarNode.