16#include "../../core/enum_type.hpp"
17#include "../../misc/dbg_helpers.h"
72 static const std::initializer_list<std::string_view> end_segment_reason_names = {
73 "DEAD_END",
"RAIL_TYPE",
"INFINITE_LOOP",
"SEGMENT_TOO_LONG",
"CHOICE_FOLLOWS",
74 "DEPOT",
"WAYPOINT",
"STATION",
"SAFE_TILE",
75 "PATH_TOO_LONG",
"FIRST_TWO_WAY_RED",
"LOOK_AHEAD_END",
"TARGET_REACHED"
79 ss <<
"0x" << std::setfill(
'0') << std::setw(4) << std::hex << flags.
base();
80 ss <<
" (" <<
ComposeNameT(flags, end_segment_reason_names,
"UNK") <<
")";
constexpr Tstorage base() const noexcept
Retrieve the raw value behind this bit set.
std::string ValueStr(Trackdir td)
Return name of given Trackdir.
std::string ComposeNameT(E value, T &t, const char *t_unk, E val_inv, const char *name_inv)
Helper template function that returns compound bitfield name that is concatenation of names of each s...
@ 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
@ FirstTwoWayRed
first signal was 2-way and it was red
@ LookAheadEnd
we have just passed the last look-ahead signal
@ InfiniteLoop
infinite loop detected
@ Depot
stop in the depot (could be a target next time)
@ TargetReached
we have just reached the destination
@ SafeTile
safe waiting position found (could be a target)
@ PathTooLong
the path is too long (searching for the nearest depot in the given radius)