10 #ifndef YAPF_NODE_RAIL_HPP
11 #define YAPF_NODE_RAIL_HPP
25 m_value = src.m_value;
30 m_value = (node_key.m_tile.base() << 4) | node_key.m_td;
33 inline int32_t CalcHash()
const
50 return m_value == other.m_value;
71 EndSegmentReasonBits m_end_segment_reason;
81 , m_end_segment_reason(ESRB_NONE)
82 , m_hash_next(
nullptr)
85 inline const Key &GetKey()
const
92 return m_key.GetTile();
108 dmp.
WriteTile(
"m_last_tile", m_last_tile);
111 dmp.
WriteTile(
"m_last_signal_tile", m_last_signal_tile);
112 dmp.
WriteEnumT(
"m_last_signal_td", m_last_signal_td);
113 dmp.
WriteEnumT(
"m_end_segment_reason", m_end_segment_reason);
118 template <
class Tkey_>
126 uint16_t m_num_signals_passed;
128 uint32_t m_inherited_flags;
132 bool m_last_signal_was_red;
140 base::Set(parent, tile, td, is_choice);
142 if (parent ==
nullptr) {
143 m_num_signals_passed = 0;
144 flags_u.m_inherited_flags = 0;
158 m_num_signals_passed = parent->m_num_signals_passed;
159 flags_u.m_inherited_flags = parent->flags_u.m_inherited_flags;
160 m_last_red_signal_type = parent->m_last_red_signal_type;
161 m_last_signal_type = parent->m_last_signal_type;
163 flags_u.flags_s.m_choice_seen |= is_choice;
168 assert(m_segment !=
nullptr);
169 return m_segment->m_last_tile;
172 inline Trackdir GetLastTrackdir()
const
174 assert(m_segment !=
nullptr);
175 return m_segment->m_last_td;
180 assert(m_segment !=
nullptr);
181 m_segment->m_last_tile = tile;
182 m_segment->m_last_td = td;
185 template <
class Tbase,
class Tfunc,
class Tpf>
188 typename Tbase::TrackFollower ft(v, yapf.GetCompatibleRailTypes());
190 Trackdir cur_td = base::GetTrackdir();
192 while (cur != GetLastTile() || cur_td != GetLastTrackdir()) {
193 if (!((obj.*func)(cur, cur_td)))
return false;
195 if (!ft.Follow(cur, cur_td))
break;
201 return (obj.*func)(cur, cur_td);
208 dmp.
WriteValue(
"m_num_signals_passed", m_num_signals_passed);
209 dmp.
WriteValue(
"m_targed_seen", flags_u.flags_s.m_targed_seen ?
"Yes" :
"No");
210 dmp.
WriteValue(
"m_choice_seen", flags_u.flags_s.m_choice_seen ?
"Yes" :
"No");
211 dmp.
WriteValue(
"m_last_signal_was_red", flags_u.flags_s.m_last_signal_was_red ?
"Yes" :
"No");
212 dmp.
WriteEnumT(
"m_last_red_signal_type", m_last_red_signal_type);