CoriEngine
Loading...
Searching...
No Matches
Cori::World::StaticEntityView< View > Class Template Reference

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

#include <EntityView.hpp>

Classes

class  Iterator

Public Types

using UnderlyingIterator = typename View::iterator

Public Member Functions

 StaticEntityView (View view, entt::registry &registry)
template<typename... T>
decltype(auto) Get (Entity entity)
 Retries the components from an entity, both the components and the entity should be in a view, faster than GetComponents.
template<typename T>
size_t Size ()
 Checks how many entities in a view have a specific component.
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.
auto begin ()
auto end ()

Detailed Description

template<typename View>
class Cori::World::StaticEntityView< View >

A wrapper for an EnTT compile-time view that provides an iterator to access Entity instances directly.

Note
Don't create directly, use Scene::StaticView.

Definition at line 18 of file EntityView.hpp.

Member Typedef Documentation

◆ UnderlyingIterator

template<typename View>
using Cori::World::StaticEntityView< View >::UnderlyingIterator = typename View::iterator

Definition at line 20 of file EntityView.hpp.

Constructor & Destructor Documentation

◆ StaticEntityView()

template<typename View>
Cori::World::StaticEntityView< View >::StaticEntityView ( View view,
entt::registry & registry )
inline

Definition at line 51 of file EntityView.hpp.

Member Function Documentation

◆ begin()

template<typename View>
auto Cori::World::StaticEntityView< View >::begin ( )
inline

Definition at line 94 of file EntityView.hpp.

◆ Contains()

template<typename View>
bool Cori::World::StaticEntityView< View >::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 90 of file EntityView.hpp.

Here is the call graph for this function:

◆ end()

template<typename View>
auto Cori::World::StaticEntityView< View >::end ( )
inline

Definition at line 95 of file EntityView.hpp.

◆ Get()

template<typename View>
template<typename... T>
decltype(auto) Cori::World::StaticEntityView< View >::Get ( Entity entity)
inlinenodiscard

Retries the components from an entity, both the components and the entity should be in a view, faster than GetComponents.

Template Parameters
TComponents to retrieve.
Parameters
entityEntity from which to retrieve the component.
Returns
References to the requested component(s).

Definition at line 61 of file EntityView.hpp.

Here is the call graph for this function:

◆ Size()

template<typename View>
template<typename T>
size_t Cori::World::StaticEntityView< View >::Size ( )
inlinenodiscard

Checks how many entities in a view have a specific component.

Template Parameters
TComponent type.
Returns
Amount of entities with component T in a view.
Note
Not available if view has components with in_place_delete policy.

Definition at line 72 of file EntityView.hpp.

◆ SizeHint()

template<typename View>
size_t Cori::World::StaticEntityView< View >::SizeHint ( ) const
inlinenodiscard

Checks the estimate amount of entities in the view.

Returns
Estimate size hint.
Note
Only available if view has components with in_place_delete policy.

Definition at line 81 of file EntityView.hpp.


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