CoriEngine
Loading...
Searching...
No Matches
Cori::World::DynamicEntityView Class Reference

A wrapper for an EnTT runtime view that provides an iterator to access Entity instances directly. More...

#include <EntityView.hpp>

Classes

class  Iterator

Public Types

using UnderlyingIterator = entt::runtime_view::iterator

Public Member Functions

 DynamicEntityView (entt::registry &registry)
 Constructs a runtime view wrapper.
template<typename... T>
DynamicEntityViewWith () &
 Adds one or more component types to the view's filter.
template<typename... T>
DynamicEntityView && With () &&
 Adds one or more component types to the view's filter.
template<typename... T>
DynamicEntityViewWithout () &
 Excludes one or more component types from the view's filter.
template<typename... T>
DynamicEntityView && Without () &&
 Excludes one or more component types from the view's filter.
size_t SizeHint () const
 Checks the estimate amount of entities in the view.
bool Contains (const Entity entity) const
 Checks if view contains a specific entity.
void Clear ()
 Completely clear the view.
auto begin ()
auto end ()

Detailed Description

A wrapper for an EnTT runtime view that provides an iterator to access Entity instances directly.

This view is configured at runtime, offering flexibility at a slight performance cost compared to a compile-time/static view. Use this when the exact set of components to iterate over is not known at compile-time.

Definition at line 107 of file EntityView.hpp.

Member Typedef Documentation

◆ UnderlyingIterator

using Cori::World::DynamicEntityView::UnderlyingIterator = entt::runtime_view::iterator

Definition at line 181 of file EntityView.hpp.

Constructor & Destructor Documentation

◆ DynamicEntityView()

Cori::World::DynamicEntityView::DynamicEntityView ( entt::registry & registry)
inlineexplicit

Constructs a runtime view wrapper.

Parameters
registryA reference to the EnTT registry.

Definition at line 114 of file EntityView.hpp.

Member Function Documentation

◆ begin()

auto Cori::World::DynamicEntityView::begin ( )
inline

Definition at line 211 of file EntityView.hpp.

◆ Clear()

void Cori::World::DynamicEntityView::Clear ( )
inline

Completely clear the view.

Definition at line 177 of file EntityView.hpp.

◆ Contains()

bool Cori::World::DynamicEntityView::Contains ( const Entity entity) const
inlinenodiscard

Checks if view contains a specific entity.

Parameters
entityEntity to check the presence of.
Returns
True if persent, false otherwise.

Definition at line 170 of file EntityView.hpp.

Here is the call graph for this function:

◆ end()

auto Cori::World::DynamicEntityView::end ( )
inline

Definition at line 212 of file EntityView.hpp.

◆ SizeHint()

size_t Cori::World::DynamicEntityView::SizeHint ( ) const
inlinenodiscard

Checks the estimate amount of entities in the view.

Returns
Estimate size hint.

Definition at line 161 of file EntityView.hpp.

◆ With() [1/2]

template<typename... T>
DynamicEntityView & Cori::World::DynamicEntityView::With ( ) &
inline

Adds one or more component types to the view's filter.

Template Parameters
TThe component types to include.

Definition at line 122 of file EntityView.hpp.

Here is the call graph for this function:

◆ With() [2/2]

template<typename... T>
DynamicEntityView && Cori::World::DynamicEntityView::With ( ) &&
inline

Adds one or more component types to the view's filter.

Template Parameters
TThe component types to include.

Definition at line 132 of file EntityView.hpp.

Here is the call graph for this function:

◆ Without() [1/2]

template<typename... T>
DynamicEntityView & Cori::World::DynamicEntityView::Without ( ) &
inline

Excludes one or more component types from the view's filter.

Template Parameters
TThe component types to exclude.

Definition at line 142 of file EntityView.hpp.

Here is the call graph for this function:

◆ Without() [2/2]

template<typename... T>
DynamicEntityView && Cori::World::DynamicEntityView::Without ( ) &&
inline

Excludes one or more component types from the view's filter.

Template Parameters
TThe component types to exclude.

Definition at line 152 of file EntityView.hpp.

Here is the call graph for this function:

The documentation for this class was generated from the following file: