OpenTTD Source: src/linkgraph/linkgraphschedule.h File Reference

OpenTTD Source 15.3

Data Structures | Functions
linkgraphschedule.h File Reference

Declaration of link graph schedule used for cargo distribution. More...

`#include "linkgraph.h"`

Go to the source code of this file.

## Data Structures
class | ComponentHandler
| A handler doing "something" on a link graph component. More...
class | LinkGraphSchedule

## Functions
void | StateGameLoop_LinkGraphPauseControl ()
| Pause the game if in 2 TimerGameEconomy::date_fract ticks, we would do a join with the next link graph job, but it is still running.
void | AfterLoad_LinkGraphPauseControl ()
| Pause the game on load if we would do a join with the next link graph job, but it is still running, and it would not be caught by a call to StateGameLoop_LinkGraphPauseControl().

## Detailed Description

Declaration of link graph schedule used for cargo distribution.

Definition in file linkgraphschedule.h.

## Function Documentation

## ◆ AfterLoad_LinkGraphPauseControl()

void AfterLoad_LinkGraphPauseControl | ( |  | ) |

Pause the game on load if we would do a join with the next link graph job, but it is still running, and it would not be caught by a call to StateGameLoop_LinkGraphPauseControl().

Definition at line 191 of file linkgraphschedule.cpp.

References _pause_mode, LinkGraphSchedule::instance, LinkGraph, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().

Referenced by AfterLoadLinkGraphs().

## ◆ StateGameLoop_LinkGraphPauseControl()

void StateGameLoop_LinkGraphPauseControl | ( |  | ) |

Pause the game if in 2 TimerGameEconomy::date_fract ticks, we would do a join with the next link graph job, but it is still running.

The check is done 2 TimerGameEconomy::date_fract ticks early instead of 1, as in multiplayer calls to DoCommandP are executed after a delay of 1 TimerGameEconomy::date_fract tick. If we previously paused, unpause if the job is now ready to be joined with.

Definition at line 169 of file linkgraphschedule.cpp.

References _pause_mode, _settings_game, TimerGameEconomy::date, TimerGameEconomy::date_fract, LinkGraphSchedule::instance, LinkGraphSchedule::IsJoinWithUnfinishedJobDue(), LinkGraph, GameSettings::linkgraph, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::None(), LinkGraphSettings::recalc_interval, TimerGameConst< struct Economy >::SECONDS_PER_DAY, LinkGraphSchedule::SPAWN_JOIN_TICK, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by StateGameLoop().