Data Structures | |
struct | TILE |
Public Types | |
typedef Types::Tpf | Tpf |
the pathfinder class (derived from THIS class) | |
typedef Types::TrackFollower | TrackFollower |
typedef Types::NodeList::Titem | Node |
this will be our node type | |
typedef Node::Key | Key |
key to hash tables | |
typedef Node::CachedData | CachedData |
Public Member Functions | |
FORCEINLINE int | SlopeCost (TileIndex tile, Trackdir td) |
FORCEINLINE int | CurveCost (Trackdir td1, Trackdir td2) |
FORCEINLINE int | SwitchCost (TileIndex tile1, TileIndex tile2, DiagDirection exitdir) |
FORCEINLINE int | OneTileCost (TileIndex &tile, Trackdir trackdir) |
Return one tile cost (base cost + level crossing penalty). | |
FORCEINLINE bool | IsAnyStationTileReserved (TileIndex tile, Trackdir trackdir, int skipped) |
Check for a reserved station platform. | |
FORCEINLINE int | ReservationCost (Node &n, TileIndex tile, Trackdir trackdir, int skipped) |
The cost for reserved tiles, including skipped ones. | |
int | SignalCost (Node &n, TileIndex tile, Trackdir trackdir) |
FORCEINLINE int | PlatformLengthPenalty (int platform_length) |
FORCEINLINE void | SetMaxCost (int max_cost) |
FORCEINLINE bool | PfCalcCost (Node &n, const TrackFollower *tf) |
Called by YAPF to calculate the cost from the origin to the given node. | |
FORCEINLINE bool | CanUseGlobalCache (Node &n) const |
FORCEINLINE void | ConnectNodeToCachedData (Node &n, CachedData &ci) |
void | DisableCache (bool disable) |
Data Fields | |
bool | m_stopped_on_first_two_way_signal |
Protected Member Functions | |
Tpf & | Yapf () |
to access inherited path finder | |
Protected Attributes | |
int | m_max_cost |
CBlobT< int > | m_sig_look_ahead_costs |
bool | m_disable_cache |
Static Protected Attributes | |
static const int | s_max_segment_cost = 10000 |
Definition at line 18 of file yapf_costrail.hpp.
FORCEINLINE bool CYapfCostRailT< Types >::IsAnyStationTileReserved | ( | TileIndex | tile, | |
Trackdir | trackdir, | |||
int | skipped | |||
) | [inline] |
Check for a reserved station platform.
Definition at line 159 of file yapf_costrail.hpp.
References HasStationReservation(), ReverseTrackdir(), TileOffsByDiagDir(), and TrackdirToExitdir().
Referenced by CYapfCostRailT< Types >::ReservationCost().
FORCEINLINE int CYapfCostRailT< Types >::OneTileCost | ( | TileIndex & | tile, | |
Trackdir | trackdir | |||
) | [inline] |
Return one tile cost (base cost + level crossing penalty).
Definition at line 134 of file yapf_costrail.hpp.
References GetTileType(), IsDiagonalTrackdir(), IsLevelCrossing(), MP_ROAD, CYapfCostRailT< Types >::Yapf(), YAPF_TILE_CORNER_LENGTH, and YAPF_TILE_LENGTH.
FORCEINLINE bool CYapfCostRailT< Types >::PfCalcCost | ( | Node & | n, | |
const TrackFollower * | tf | |||
) | [inline] |
Called by YAPF to calculate the cost from the origin to the given node.
Calculates only the cost of given node, adds it to the parent node cost and stores the result into Node::m_cost member
Definition at line 284 of file yapf_costrail.hpp.
References _settings_game, Vehicle::current_order, FindFirstBit2x64(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::Follow(), PathfinderSettings::forbid_90_deg, SpecializedStation< Waypoint, true >::Get(), BaseStation::GetByTile(), Order::GetDestination(), Train::GetDisplayMaxSpeed(), BaseStation::GetPlatformLength(), GetSignalStateByTrackdir(), GetStationIndex(), HasOnewaySignalBlockingTrackdir(), HasSignalOnTrackdir(), INVALID_TILE, INVALID_TRACKDIR, IsRailDepot(), IsRailWaypoint(), IsSafeWaitingPosition(), IsTileType(), Order::IsType(), IsWaitingPositionFree(), KillFirstBit(), CYapfCostRailT< Types >::m_max_cost, CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::m_new_td_bits, CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::m_new_tile, MP_RAILWAY, MP_STATION, GameSettings::pf, RemoveFirstTrackdir(), ReverseDiagDir(), ReverseTrackdir(), SIGNAL_STATE_RED, SIGTYPE_EXIT, SIGTYPE_PBS_ONEWAY, CBlobT< T >::Size(), TRACKDIR_BIT_NONE, TrackdirToExitdir(), TrackdirToTrack(), TrackdirToTrackdirBits(), CYapfCostRailT< Types >::Yapf(), and YAPF_TILE_LENGTH.
FORCEINLINE int CYapfCostRailT< Types >::ReservationCost | ( | Node & | n, | |
TileIndex | tile, | |||
Trackdir | trackdir, | |||
int | skipped | |||
) | [inline] |
The cost for reserved tiles, including skipped ones.
Definition at line 169 of file yapf_costrail.hpp.
References GetReservedTrackbits(), CYapfCostRailT< Types >::IsAnyStationTileReserved(), IsDiagonalTrackdir(), IsRailStationTile(), CBlobT< T >::Size(), TrackdirToTrack(), TrackOverlapsTracks(), CYapfCostRailT< Types >::Yapf(), YAPF_TILE_CORNER_LENGTH, and YAPF_TILE_LENGTH.
int CYapfCostRailT< Types >::m_max_cost [protected] |
Definition at line 68 of file yapf_costrail.hpp.
Referenced by CYapfCostRailT< Types >::PfCalcCost().