@@ -9,13 +9,20 @@
/** @file yapf_costbase.hpp Handling of cost determination. */
#ifndef YAPF_COSTBASE_HPP
#define YAPF_COSTBASE_HPP
/** Base implementation for cost accounting. */
struct CYapfCostBase {
/**
* Does the given track direction on the given tile yeild an uphill penalty?
* @param tile The tile to check.
* @param td The track direction to check.
* @return True if there's a slope, otherwise false.
*/
FORCEINLINE static bool stSlopeCost(TileIndex tile, Trackdir td)
{
if (IsDiagonalTrackdir(td)) {
if (IsBridgeTile(tile)) {
/* it is bridge ramp, check if we are entering the bridge */
if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are leaving it, no penalty
@@ -31,12 +38,7 @@ struct CYapfCostBase {
}
return false;
};
struct CostRailSettings {
/* look-ahead signal penalty */
#endif /* YAPF_COSTBASE_HPP */