From 1665302bd0bf16235397d08b1201e2d94778f3cc Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 20 Aug 2023 21:53:44 +0300 Subject: [PATCH] #1027 get scope from name --- include/flecs/addons/cpp/impl/world.hpp | 4 ++++ include/flecs/addons/cpp/world.hpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/flecs/addons/cpp/impl/world.hpp b/include/flecs/addons/cpp/impl/world.hpp index ce2e383cc..4e75922b8 100644 --- a/include/flecs/addons/cpp/impl/world.hpp +++ b/include/flecs/addons/cpp/impl/world.hpp @@ -280,4 +280,8 @@ inline flecs::scoped_world world::scope() const { return scoped_world(m_world, parent); } +inline flecs::scoped_world world::scope(const char* name) const { + return scope(entity(name)); +} + } // namespace flecs diff --git a/include/flecs/addons/cpp/world.hpp b/include/flecs/addons/cpp/world.hpp index 4a277c398..f02ddfc42 100644 --- a/include/flecs/addons/cpp/world.hpp +++ b/include/flecs/addons/cpp/world.hpp @@ -868,6 +868,8 @@ struct world { template flecs::scoped_world scope() const; + flecs::scoped_world scope(const char* name) const; + /** Delete all entities with specified id. */ void delete_with(id_t the_id) const { ecs_delete_with(m_world, the_id);