The road pathfinding. More...
#include "../../stdafx.h"#include "yapf.hpp"#include "yapf_node_road.hpp"#include "../../roadstop_base.h"Go to the source code of this file.
Data Structures | |
| class | CYapfCostRoadT< Types > |
| class | CYapfDestinationAnyDepotRoadT< Types > |
| class | CYapfDestinationTileRoadT< Types > |
| class | CYapfFollowRoadT< Types > |
| struct | CYapfRoad_TypesT< Tpf_, Tnode_list, Tdestination > |
| struct | CYapfRoad1 |
| struct | CYapfRoad2 |
| struct | CYapfRoadAnyDepot1 |
| struct | CYapfRoadAnyDepot2 |
Functions | |
| Trackdir | YapfRoadVehicleChooseTrack (const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs) |
| Finds the best path for given road vehicle using YAPF. | |
| FindDepotData | YapfRoadVehicleFindNearestDepot (const RoadVehicle *v, int max_distance) |
| Used when user sends road vehicle to the nearest depot or if road vehicle needs servicing using YAPF. | |
The road pathfinding.
Definition in file yapf_road.cpp.
| Trackdir YapfRoadVehicleChooseTrack | ( | const RoadVehicle * | v, | |
| TileIndex | tile, | |||
| DiagDirection | enterdir, | |||
| TrackdirBits | trackdirs | |||
| ) |
Finds the best path for given road vehicle using YAPF.
| v | the RV that needs to find a path | |
| tile | the tile to find the path from (should be next tile the RV is about to enter) | |
| enterdir | diagonal direction which the RV will enter this new tile from | |
| trackdirs | available trackdirs on the new tile (to choose from) |
Definition at line 465 of file yapf_road.cpp.
References _settings_game, YAPFSettings::disable_node_optimization, FindFirstBit2x64(), INVALID_TRACKDIR, GameSettings::pf, and PathfinderSettings::yapf.
Referenced by RoadFindPathToDest().
| FindDepotData YapfRoadVehicleFindNearestDepot | ( | const RoadVehicle * | v, | |
| int | max_penalty | |||
| ) |
Used when user sends road vehicle to the nearest depot or if road vehicle needs servicing using YAPF.
| v | vehicle that needs to go to some depot | |
| max_penalty | max distance (in pathfinder penalty) from the current vehicle position (used also as optimization - the pathfinder can stop path finding if max_penalty was reached and no depot was seen) |
Definition at line 480 of file yapf_road.cpp.
References _settings_game, FindDepotData::best_length, YAPFSettings::disable_node_optimization, GetTileTrackStatus(), RoadVehicle::GetVehicleTrackdir(), GameSettings::pf, FindDepotData::tile, Vehicle::tile, TrackdirToTrackdirBits(), TrackStatusToTrackdirBits(), TRANSPORT_ROAD, and PathfinderSettings::yapf.
1.6.1