OpenTTD Source  1.11.2
yapf_ship.cpp File Reference
#include "../../stdafx.h"
#include "../../ship.h"
#include "../../industry.h"
#include "../../vehicle_func.h"
#include "yapf.hpp"
#include "yapf_node_ship.hpp"
#include "../../safeguards.h"

Go to the source code of this file.

Data Structures

class  CYapfDestinationTileWaterT< Types >
 
class  CYapfFollowShipT< Types >
 Node Follower module of YAPF for ships. More...
 
class  CYapfCostShipT< Types >
 Cost Provider module of YAPF for ships. More...
 
struct  CYapfShip_TypesT< Tpf_, Ttrack_follower, Tnode_list >
 Config struct of YAPF for ships. More...
 
struct  CYapfShip1
 
struct  CYapfShip2
 

Functions

static bool RequireTrackdirKey ()
 
Track YapfShipChooseTrack (const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, ShipPathCache &path_cache)
 Ship controller helper - path finder invoker. More...
 
bool YapfShipCheckReverse (const Ship *v)
 Returns true if it is better to reverse the ship before leaving depot using YAPF. More...
 

Detailed Description

Implementation of YAPF for ships.

Definition in file yapf_ship.cpp.

Function Documentation

◆ YapfShipCheckReverse()

bool YapfShipCheckReverse ( const Ship v)

Returns true if it is better to reverse the ship before leaving depot using YAPF.

Parameters
vthe ship leaving the depot
Returns
true if reversing is better

Definition at line 366 of file yapf_ship.cpp.

References _settings_game, YAPFSettings::disable_node_optimization, Ship::GetVehicleTrackdir(), GameSettings::pf, ReverseTrackdir(), Vehicle::tile, and PathfinderSettings::yapf.

◆ YapfShipChooseTrack()

Track YapfShipChooseTrack ( const Ship v,
TileIndex  tile,
DiagDirection  enterdir,
TrackBits  tracks,
bool &  path_found,
ShipPathCache &  path_cache 
)

Ship controller helper - path finder invoker.

Finds the best path for given ship using YAPF.

Definition at line 351 of file yapf_ship.cpp.

References _settings_game, ChooseShipTrack(), YAPFSettings::disable_node_optimization, GameSettings::pf, and PathfinderSettings::yapf.

Referenced by ChooseShipTrack().