Add tracerestrict feature reverse behind signal
This commit is contained in:
@@ -208,17 +208,25 @@ public:
|
||||
}
|
||||
|
||||
/** add multiple nodes - direct children of the given node */
|
||||
inline void AddMultipleNodes(Node *parent, const TrackFollower &tf)
|
||||
template <class TNodeFunc>
|
||||
inline void AddMultipleNodes(Node *parent, const TrackFollower &tf, TNodeFunc node_func)
|
||||
{
|
||||
bool is_choice = (KillFirstBit(tf.m_new_td_bits) != TRACKDIR_BIT_NONE);
|
||||
for (TrackdirBits rtds = tf.m_new_td_bits; rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) {
|
||||
Trackdir td = (Trackdir)FindFirstBit2x64(rtds);
|
||||
Node &n = Yapf().CreateNewNode();
|
||||
n.Set(parent, tf.m_new_tile, td, is_choice);
|
||||
node_func(n);
|
||||
Yapf().AddNewNode(n, tf);
|
||||
}
|
||||
}
|
||||
|
||||
/** add multiple nodes - direct children of the given node */
|
||||
inline void AddMultipleNodes(Node *parent, const TrackFollower &tf)
|
||||
{
|
||||
AddMultipleNodes(parent, tf, [&](Node &n) {});
|
||||
}
|
||||
|
||||
/**
|
||||
* In some cases an intermediate node branch should be pruned.
|
||||
* The most prominent case is when a red EOL signal is encountered, but
|
||||
|
Reference in New Issue
Block a user