MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Add

Method Add

src/signal.cpp:155–168  ·  view source on GitHub ↗

* Adds tile & dir into the set, checks for full set * Sets the 'overflowed' flag if the set was full * @param tile tile * @param dir and dir to add * @return true iff the item could be added (set wasn't full) */

Source from the content-addressed store, hash-verified

153 * @return true iff the item could be added (set wasn't full)
154 */
155 bool Add(TileIndex tile, Tdir dir)
156 {
157 if (this->IsFull()) {
158 overflowed = true;
159 Debug(misc, 0, "SignalSegment too complex. Set {} is full (maximum {})", name, items);
160 return false; // set is full
161 }
162
163 this->data[this->n].tile = tile;
164 this->data[this->n].dir = dir;
165 this->n++;
166
167 return true;
168 }
169
170 /**
171 * Reads the last added element into the set

Callers 7

MaybeAddToTodoSetFunction · 0.45
ExploreSegmentFunction · 0.45
UpdateSignalsInBufferFunction · 0.45
AddTrackToSignalBufferFunction · 0.45
AddSideToSignalBufferFunction · 0.45
UpdateSignalsOnSegmentFunction · 0.45

Calls 1

IsFullMethod · 0.95

Tested by

no test coverage detected