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

Method Begin

src/script/api/script_list.cpp:234–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232 ScriptListSorterItemAscending(const ScriptList *list) : ScriptListSorter(list) {}
233
234 std::optional<SQInteger> Begin() override
235 {
236 if (this->list->items.empty()) {
237 this->item_next = std::nullopt;
238 return std::nullopt;
239 }
240 this->has_no_more_items = false;
241
242 this->item_iter = this->list->items.begin();
243 this->item_next = this->item_iter->first;
244
245 std::optional<SQInteger> item_current = this->item_next;
246 this->FindNext();
247 return item_current;
248 }
249
250 void FindNext() override
251 {

Callers

nothing calls this directly

Calls 3

FindNextMethod · 0.95
emptyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected