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

Method FillUsedItems

src/object_gui.cpp:108–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 }
107
108 void FillUsedItems(std::set<PickerItem> &items) override
109 {
110 for (const Object *o : Object::Iterate()) {
111 if (GetTileOwner(o->location.tile) != _current_company) continue;
112 const ObjectSpec *spec = ObjectSpec::Get(o->type);
113 if (spec == nullptr || spec->class_index == INVALID_OBJECT_CLASS || !spec->IsEverAvailable()) continue;
114 items.insert(GetPickerItem(spec));
115 }
116 }
117
118 static ObjectPickerCallbacks instance;
119};

Callers

nothing calls this directly

Calls 3

GetTileOwnerFunction · 0.85
IsEverAvailableMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected