equal
deleted
inserted
replaced
17 typedef typename Node::CachedData CachedData; |
17 typedef typename Node::CachedData CachedData; |
18 |
18 |
19 protected: |
19 protected: |
20 int m_max_cost; |
20 int m_max_cost; |
21 CBlobT<int> m_sig_look_ahead_costs; |
21 CBlobT<int> m_sig_look_ahead_costs; |
|
22 public: |
|
23 bool m_stopped_on_first_two_way_signal; |
|
24 protected: |
22 |
25 |
23 static const int s_max_segment_cost = 10000; |
26 static const int s_max_segment_cost = 10000; |
24 |
27 |
25 CYapfCostRailT() : m_max_cost(0) |
28 CYapfCostRailT() |
|
29 : m_max_cost(0) |
|
30 , m_stopped_on_first_two_way_signal(false) |
26 { |
31 { |
27 // pre-compute look-ahead penalties into array |
32 // pre-compute look-ahead penalties into array |
28 int p0 = Yapf().PfGetSettings().rail_look_ahead_signal_p0; |
33 int p0 = Yapf().PfGetSettings().rail_look_ahead_signal_p0; |
29 int p1 = Yapf().PfGetSettings().rail_look_ahead_signal_p1; |
34 int p1 = Yapf().PfGetSettings().rail_look_ahead_signal_p1; |
30 int p2 = Yapf().PfGetSettings().rail_look_ahead_signal_p2; |
35 int p2 = Yapf().PfGetSettings().rail_look_ahead_signal_p2; |
114 // we have a red signal in our direction |
119 // we have a red signal in our direction |
115 // was it first signal which is two-way? |
120 // was it first signal which is two-way? |
116 if (Yapf().TreatFirstRedTwoWaySignalAsEOL() && n.flags_u.flags_s.m_choice_seen && has_signal_against && n.m_num_signals_passed == 0) { |
121 if (Yapf().TreatFirstRedTwoWaySignalAsEOL() && n.flags_u.flags_s.m_choice_seen && has_signal_against && n.m_num_signals_passed == 0) { |
117 // yes, the first signal is two-way red signal => DEAD END |
122 // yes, the first signal is two-way red signal => DEAD END |
118 n.m_segment->flags_u.flags_s.m_end_of_line = true; |
123 n.m_segment->flags_u.flags_s.m_end_of_line = true; |
|
124 Yapf().m_stopped_on_first_two_way_signal = true; |
119 return -1; |
125 return -1; |
120 } |
126 } |
121 SignalType sig_type = GetSignalType(tile); |
127 SignalType sig_type = GetSignalType(tile); |
122 n.m_last_red_signal_type = sig_type; |
128 n.m_last_red_signal_type = sig_type; |
123 n.flags_u.flags_s.m_last_signal_was_red = true; |
129 n.flags_u.flags_s.m_last_signal_was_red = true; |