| 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)); |