yapf_cargo.cpp File Reference

Implementation of YAPF for cargo routing. More...

#include "../../stdafx.h"
#include "../../cargodest_base.h"
#include "../../station_base.h"
#include "../../town.h"
#include "yapf.hpp"

Go to the source code of this file.

Data Structures

struct  CYapfRouteLinkNodeKeyT
 YAPF node key for cargo routing. More...
struct  CYapfRouteLinkNodeT
 YAPF node class for cargo routing. More...
struct  CFollowRouteLinkT
 Route link follower. More...
class  CYapfCostRouteLinkT< Types >
 YAPF cost provider for route links. More...
class  CYapfOriginRouteLinkT< Types >
 YAPF origin provider for route links. More...
class  CYapfDestinationRouteLinkT< Types >
 YAPF destination provider for route links. More...
class  CYapfFollowRouteLinkT< Types >
 Main route finding class. More...
struct  CYapfRouteLink_TypesT< Tpf_ >
 Config struct for route link finding. More...
struct  CYapfRouteLink

Typedefs

typedef CNodeList_HashTableT
< CYapfRouteLinkNodeT, 8, 10, 2048 > 
CRouteLinkNodeList

Functions

RouteLinkYapfChooseRouteLink (CargoID cid, const StationList *stations, TileIndex src, const TileArea &dest, StationID *start_station, StationID *next_unload, byte flags, bool *found, OrderID order, int max_cost)
 Find the best cargo routing from a station to a destination.

Detailed Description

Implementation of YAPF for cargo routing.

Definition in file yapf_cargo.cpp.


Function Documentation

RouteLink* YapfChooseRouteLink ( CargoID  cid,
const StationList stations,
TileIndex  src,
const TileArea dest,
StationID start_station,
StationID next_unload,
byte  flags,
bool *  found,
OrderID  order,
int  max_cost 
)

Find the best cargo routing from a station to a destination.

Parameters:
cid Cargo type to route.
stations Set of possible originating stations.
dest Destination tile area.
[out] start_station Station the best route link originates from.
[out] next_unload Next station the cargo should be unloaded from the vehicle.
flags Routing flags of the cargo.
[out] found True if a link was found.
order Order the vehicle arrived at the origin station.
max_cost Maxmimum allowed node cost.
Returns:
The best RouteLink to the target or NULL if either no link found or one of the origin stations is the best destination.

Definition at line 439 of file yapf_cargo.cpp.

References CYapfFollowRouteLinkT< Types >::ChooseRouteLink().

Referenced by FindRouteLinkForCargo(), and MoveCargoWithDestinationToStationWorker().


Generated on Fri Jun 3 05:19:09 2011 for OpenTTD by  doxygen 1.6.1