OpenTTD Source: CSegmentCostCacheBase Struct Reference

OpenTTD Source 15.0-RC2

Static Public Member Functions | Static Public Attributes
CSegmentCostCacheBase Struct Reference

Base class for segment cost cache providers. More...

`#include <yapf_costcache.hpp>`

Inheritance diagram for CSegmentCostCacheBase:

## Static Public Member Functions
static void | NotifyTrackLayoutChange (TileIndex, Track)

## Static Public Attributes
static int | s_rail_change_counter = 0
| if any track changes, this counter is incremented - that will invalidate segment cost cache

## Detailed Description

Base class for segment cost cache providers.

Contains global counter of track layout changes and static notification function called whenever the track layout changes. It is implemented as base class because it needs to be shared between all rail YAPF types (one shared counter, one notification function.

Definition at line 45 of file yapf_costcache.hpp.

## Member Function Documentation

## ◆ NotifyTrackLayoutChange()

static void CSegmentCostCacheBase::NotifyTrackLayoutChange | ( | TileIndex | ,
|  | Track |
| ) |  |
| inlinestatic

Definition at line 48 of file yapf_costcache.hpp.

## Field Documentation

## ◆ s_rail_change_counter

int CSegmentCostCacheBase::s_rail_change_counter = 0
| static

if any track changes, this counter is incremented - that will invalidate segment cost cache

Definition at line 46 of file yapf_costcache.hpp.

The documentation for this struct was generated from the following files:

- src/pathfinder/yapf/yapf_costcache.hpp
- src/pathfinder/yapf/yapf_rail.cpp