OpenTTD Source: src/pathfinder/yapf/yapf_type.hpp File Reference

OpenTTD Source 15.3

Typedefs | Enumerations | Functions | Variables
yapf_type.hpp File Reference

Types used by YAPF. More...

`#include "../../core/enum_type.hpp"`
`#include "../../misc/dbg_helpers.h"`

Go to the source code of this file.

## Typedefs
using | EndSegmentReasons = EnumBitSet< EndSegmentReason, uint16_t >

## Enumerations
enum class | EndSegmentReason : uint8_t { DeadEnd , RailType , InfiniteLoop , SegmentTooLong , ChoiceFollows , Depot , Waypoint , Station , SafeTile , PathTooLong , FirstTwoWayRed , LookAheadEnd , TargetReached }

## Functions
std::string | ValueStr (EndSegmentReasons flags)

## Variables
static constexpr EndSegmentReasons | ESRF_POSSIBLE_TARGET
static constexpr EndSegmentReasons | ESRF_CACHED_MASK
static constexpr EndSegmentReasons | ESRF_ABORT_PF_MASK

## Detailed Description

Types used by YAPF.

Definition in file yapf_type.hpp.

## Typedef Documentation

## ◆ EndSegmentReasons

using EndSegmentReasons = EnumBitSet<EndSegmentReason, uint16_t>

Definition at line 36 of file yapf_type.hpp.

## Enumeration Type Documentation

## ◆ EndSegmentReason

enum class EndSegmentReason : uint8_t
| strong

Enumerator
DeadEnd | track ends here
RailType | the next tile has a different rail type than our tiles
InfiniteLoop | infinite loop detected
SegmentTooLong | the segment is too long (possible infinite loop)
ChoiceFollows | the next tile contains a choice (the track splits to more than one segments)
Depot | stop in the depot (could be a target next time)
Waypoint | waypoint encountered (could be a target next time)
Station | station encountered (could be a target next time)
SafeTile | safe waiting position found (could be a target)
PathTooLong | the path is too long (searching for the nearest depot in the given radius)
FirstTwoWayRed | first signal was 2-way and it was red
LookAheadEnd | we have just passed the last look-ahead signal
TargetReached | we have just reached the destination

Definition at line 17 of file yapf_type.hpp.

## Function Documentation

## ◆ ValueStr()

std::string ValueStr | ( | EndSegmentReasons | flags | ) |
| inline

Definition at line 67 of file yapf_type.hpp.

## Variable Documentation

## ◆ ESRF_ABORT_PF_MASK

constexpr EndSegmentReasons ESRF_ABORT_PF_MASK
| staticconstexpr

Initial value:
= {
EndSegmentReason::DeadEnd,
EndSegmentReason::PathTooLong,
EndSegmentReason::InfiniteLoop,
EndSegmentReason::FirstTwoWayRed,
}
EndSegmentReason::FirstTwoWayRed
@ FirstTwoWayRed
first signal was 2-way and it was red
EndSegmentReason::InfiniteLoop
@ InfiniteLoop
infinite loop detected
EndSegmentReason::DeadEnd
@ DeadEnd
track ends here
EndSegmentReason::PathTooLong
@ PathTooLong
the path is too long (searching for the nearest depot in the given radius)

Definition at line 60 of file yapf_type.hpp.

## ◆ ESRF_CACHED_MASK

constexpr EndSegmentReasons ESRF_CACHED_MASK
| staticconstexpr

Initial value:
= {
EndSegmentReason::DeadEnd,
EndSegmentReason::RailType,
EndSegmentReason::InfiniteLoop,
EndSegmentReason::SegmentTooLong,
EndSegmentReason::ChoiceFollows,
EndSegmentReason::Depot,
EndSegmentReason::Waypoint,
EndSegmentReason::Station,
EndSegmentReason::SafeTile,
}
EndSegmentReason::SegmentTooLong
@ SegmentTooLong
the segment is too long (possible infinite loop)
EndSegmentReason::ChoiceFollows
@ ChoiceFollows
the next tile contains a choice (the track splits to more than one segments)
EndSegmentReason::Waypoint
@ Waypoint
waypoint encountered (could be a target next time)
EndSegmentReason::Station
@ Station
station encountered (could be a target next time)
EndSegmentReason::RailType
@ RailType
the next tile has a different rail type than our tiles
EndSegmentReason::Depot
@ Depot
stop in the depot (could be a target next time)
EndSegmentReason::SafeTile
@ SafeTile
safe waiting position found (could be a target)

Definition at line 47 of file yapf_type.hpp.

## ◆ ESRF_POSSIBLE_TARGET

constexpr EndSegmentReasons ESRF_POSSIBLE_TARGET
| staticconstexpr

Initial value:
= {
EndSegmentReason::Depot,
EndSegmentReason::Waypoint,
EndSegmentReason::Station,
EndSegmentReason::SafeTile,
}

Definition at line 39 of file yapf_type.hpp.