SpiecsEngine
 
Loading...
Searching...
No Matches

◆ ViewComponent() [1/3]

template<typename T , typename F >
void Spices::World::ViewComponent ( const std::vector< uint32_t > & ranges,
F && fn )

View all component in this world in ranges.

Template Parameters
TComponent.
Parameters
[in]rangesview ranges.
fnView function.

Definition at line 293 of file World.h.

294 {
296
297 std::shared_lock<std::shared_mutex> lock(m_Mutex);
298
299 for(auto range : ranges)
300 {
301 auto e = static_cast<entt::entity>(range);
302 auto& comp = m_Registry.get<T>(e);
303
304 fn(e, comp);
305 }
306 }
#define SPICES_PROFILE_ZONE
entt::registry m_Registry
This variable handles all entity.
Definition World.h:250
std::shared_mutex m_Mutex
Mutex for world.
Definition World.h:245