OpenTTD Source: CYapfCostRegionT< Types > Class Template Reference

OpenTTD Source 15.0-beta1

Public Types | Public Member Functions | Protected Member Functions
CYapfCostRegionT< Types > Class Template Reference

Cost Provider of YAPF for water regions. More...

## Public Types
typedef Types::Tpf | Tpf
| The pathfinder class (derived from THIS class).
typedef Types::TrackFollower | TrackFollower
typedef Types::NodeList::Item | Node
| This will be our node type.
typedef Node::Key | Key
| Key to hash tables.

## Public Member Functions
bool | PfCalcCost (Node &n, const TrackFollower *)
| Called by YAPF to calculate the cost from the origin to the given node.

## Protected Member Functions
Tpf & | Yapf ()
| To access inherited path finder.

## Detailed Description

template<class Types>
class CYapfCostRegionT< Types >

Cost Provider of YAPF for water regions.

Definition at line 225 of file yapf_ship_regions.cpp.

## Member Typedef Documentation

## ◆ Key

template<class Types >

typedef Node::Key CYapfCostRegionT< Types >::Key

Key to hash tables.

Definition at line 231 of file yapf_ship_regions.cpp.

## ◆ Node

template<class Types >

typedef Types::NodeList::Item CYapfCostRegionT< Types >::Node

This will be our node type.

Definition at line 230 of file yapf_ship_regions.cpp.

## ◆ Tpf

template<class Types >

typedef Types::Tpf CYapfCostRegionT< Types >::Tpf

The pathfinder class (derived from THIS class).

Definition at line 228 of file yapf_ship_regions.cpp.

## ◆ TrackFollower

template<class Types >

typedef Types::TrackFollower CYapfCostRegionT< Types >::TrackFollower

Definition at line 229 of file yapf_ship_regions.cpp.

## Member Function Documentation

## ◆ PfCalcCost()

template<class Types >

bool CYapfCostRegionT< Types >::PfCalcCost | ( | Node & | n,
|  | const TrackFollower * |
| ) |  |
| 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 243 of file yapf_ship_regions.cpp.

References DIAGDIRDIFF_90LEFT, DIAGDIRDIFF_90RIGHT, and DiagDirDifference().

## ◆ Yapf()

template<class Types >

Tpf & CYapfCostRegionT< Types >::Yapf | ( |  | ) |
| inlineprotected

To access inherited path finder.

Definition at line 235 of file yapf_ship_regions.cpp.

The documentation for this class was generated from the following file:

- src/pathfinder/yapf/yapf_ship_regions.cpp