OpenTTD Source 20250312-master-gcdcc6b491d
yapf_type.hpp File Reference

Types used by YAPF. More...

#include <iomanip>
#include <sstream>
#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

Definition at line 39 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 20 of file yapf_type.hpp.

Function Documentation

◆ ValueStr()

std::string ValueStr ( EndSegmentReasons  flags)
inline

Definition at line 70 of file yapf_type.hpp.

Variable Documentation

◆ ESRF_ABORT_PF_MASK

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

Definition at line 63 of file yapf_type.hpp.

◆ ESRF_CACHED_MASK

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

Definition at line 50 of file yapf_type.hpp.

◆ ESRF_POSSIBLE_TARGET

constexpr EndSegmentReasons ESRF_POSSIBLE_TARGET
staticconstexpr