MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / containerItemAt

Method containerItemAt

source/game/scripting/StarWorldLuaBindings.cpp:1617–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1615 }
1616
1617 Json WorldEntityCallbacks::containerItemAt(World* world, EntityId entityId, size_t offset) {
1618 if (auto container = world->get<ContainerObject>(entityId)) {
1619 auto itemDb = Root::singleton().itemDatabase();
1620 auto items = container->itemBag()->items();
1621 if (offset < items.size()) {
1622 return itemDb->toJson(items.at(offset));
1623 }
1624 }
1625
1626 return Json();
1627 }
1628
1629 Maybe<bool> WorldEntityCallbacks::containerConsume(World* world, EntityId entityId, Json const& items) {
1630 if (auto container = world->get<ContainerObject>(entityId)) {

Callers

nothing calls this directly

Calls 8

singletonClass · 0.85
JsonClass · 0.85
itemDatabaseMethod · 0.80
itemsMethod · 0.80
itemBagMethod · 0.80
sizeMethod · 0.45
toJsonMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected