KUDr@3900: /* $Id$ */ KUDr@3900: rubidium@9111: /** @file yapf_costbase.hpp Handling of cost determination. */ rubidium@9111: KUDr@3900: #ifndef YAPF_COSTBASE_HPP KUDr@3900: #define YAPF_COSTBASE_HPP KUDr@3900: KUDr@3900: struct CYapfCostBase { KUDr@3900: FORCEINLINE static bool stSlopeCost(TileIndex tile, Trackdir td) KUDr@3900: { KUDr@5139: if (IsDiagonalTrackdir(td)) { celestar@5385: if (IsBridgeTile(tile)) { KUDr@5139: // it is bridge ramp, check if we are entering the bridge smatz@8083: if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty KUDr@5139: // we are entering the bridge frosch@8379: Slope tile_slope = GetTileSlope(tile, NULL); frosch@8379: Axis axis = DiagDirToAxis(GetTunnelBridgeDirection(tile)); frosch@8379: return !HasBridgeFlatRamp(tile_slope, axis); KUDr@5139: } else { KUDr@5139: // not bridge ramp KUDr@5139: if (IsTunnelTile(tile)) return false; // tunnel entry/exit doesn't slope frosch@8653: Slope tile_slope = GetTileSlope(tile, NULL); frosch@8653: return IsUphillTrackdir(tile_slope, td); // slopes uphill => apply penalty KUDr@3900: } KUDr@3900: } KUDr@3900: return false; KUDr@3900: } KUDr@3900: }; KUDr@3900: KUDr@3900: struct CostRailSettings { KUDr@3900: // look-ahead signal penalty KUDr@3900: }; KUDr@3900: KUDr@3900: KUDr@3900: #endif /* YAPF_COSTBASE_HPP */