class ecs::RuntimeView

Creates a view that allows you to iterate over all entities that match included

& excluded type filter.

Unlike TView, included and excluded type filters can be changed dynamically at runtime, rather than having to be known at compile time. However runtime views are less performant than regular views.

Public

Constructors

RuntimeView

RuntimeView() = default

RuntimeView

RuntimeView(const RuntimeView &) = default

RuntimeView

RuntimeView(RuntimeView &&) = default

Methods

~RuntimeView

~RuntimeView() = default

Swap

void Swap(RuntimeView &other)

Swaps internals between two views.

Include

void Include(SparseSet &storage)

Adds a storage that the entity must be a part of in order to be included in the view.

Exclude

void Exclude(SparseSet &storage)

Adds a storage that the entity must not be a part of in order to be included in the view.

Clear

void Clear()

Clears all filters from the view.

GetSizeEstimate

u64 GetSizeEstimate() const

Returns a rough number of elements in the view, based on the number of elements in the leading storage.

Begin

Iterator Begin() const

Iterator to the first entity matching the view filter.

End

Iterator End() const

Iterator past the last entity matching the view filter.

Contains

bool Contains(Entity entity) const

Returns true if the provided entity matches the view filter.

begin

iterator begin() const

end

iterator end() const

Operators

operator=

RuntimeView &operator=(const RuntimeView &) = default

operator=

RuntimeView &operator=(RuntimeView &&) = default

Private

Fields

mIncludedTypeStorage

TArray<SparseSet *> mIncludedTypeStorage

mExcludedTypeStorage

TArray<SparseSet *> mExcludedTypeStorage