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

Method objectQuery

source/game/scripting/StarWorldLuaBindings.cpp:1261–1274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1259 }
1260
1261 LuaTable WorldEntityCallbacks::objectQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe<LuaTable> options) {
1262 String objectName;
1263 if (options)
1264 objectName = options->get<Maybe<String>>("name").value();
1265
1266 return LuaBindings::entityQuery<Object>(world,
1267 engine,
1268 pos1,
1269 pos2,
1270 std::move(options),
1271 [&objectName](shared_ptr<Object> const& entity) -> bool {
1272 return objectName.empty() || entity->name() == objectName;
1273 });
1274 }
1275
1276 LuaTable WorldEntityCallbacks::itemDropQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe<LuaTable> options) {
1277 return LuaBindings::entityQuery<ItemDrop>(world, engine, pos1, pos2, std::move(options));

Callers

nothing calls this directly

Calls 3

valueMethod · 0.45
emptyMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected