Navigation
API > API/Runtime > API/Runtime/MassEntity
FMassEntityQuery is a structure that is used to trigger calculations on cached set of valid archetypes as described by requirements. See the parent classes FMassFragmentRequirements and FMassSubsystemRequirements for setting up the required fragments and subsystems.
A query to be considered valid needs declared at least one EMassFragmentPresence::All, EMassFragmentPresence::AnyEMassFragmentPresence::Optional fragment requirement.
| Name | FMassEntityQuery |
| Type | struct |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassEntityQuery.h |
| Include Path | #include "MassEntityQuery.h" |
Syntax
struct FMassEntityQuery :
public FMassFragmentRequirements ,
public FMassSubsystemRequirements
Inheritance Hierarchy
- FMassFragmentRequirements → FMassEntityQuery
- FMassSubsystemRequirements → FMassEntityQuery
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMassEntityQuery
(
const TSharedRef< FMassEntityManager >& EntityManager, |
MassEntityQuery.h | ||
FMassEntityQuery
(
const TSharedRef< FMassEntityManager >& EntityManager, |
MassEntityQuery.h | ||
FMassEntityQuery
(
TConstArrayView< const UScriptStruct* > InitList |
MassEntityQuery.h | ||
FMassEntityQuery
(
std::initializer_list< UScriptStruct* > InitList |
DEPRECATED. | MassEntityQuery.h | |
FMassEntityQuery
(
const TSharedPtr< FMassEntityManager >& EntityManager |
MassEntityQuery.h | ||
| MassEntityQuery.h | |||
FMassEntityQuery
(
UMassProcessor& Owner |
MassEntityQuery.h |
Structs
| Name | Remarks |
|---|---|
| FArchetypeGroupingStep | |
| FArchetypeMatchOverride |
Enums
Public
| Name | Remarks |
|---|---|
| EParallelExecutionFlags | |
| EParallelForMode |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ArchetypeMatchOverrideAlignment | uint32 | MassEntityQuery.h | |
| ArchetypeMatchOverrideSize | int32 | MassEntityQuery.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ArchetypeFragmentMapping | TArray< FMassQueryRequirementIndicesMapping > | MassEntityQuery.h | ||
| ArchetypeMatchOverride | FArchetypeMatchOverride | MassEntityQuery.h | ||
| bAllowParallelCommands | uint8 | Controls whether ParallelForEachEntityChunk created dedicated command buffer for each job. | MassEntityQuery.h | |
| bHasArchetypeMatchOverride | uint8 | MassEntityQuery.h | ||
| bRegistered | uint8 | MassEntityQuery.h | ||
| bRequiresMutatingWorldAccess | uint8 | MassEntityQuery.h | ||
| CachedGroupIDs | TArray< TArray< UE::Mass::FArchetypeGroupID > > | MassEntityQuery.h | ||
| ChunkCondition | FMassChunkConditionFunction | This function represents a condition that will be called for every chunk to be processed before the actual execution function is called. | MassEntityQuery.h | |
| EntitySubsystemHash | uint32 | MassEntityQuery.h | ||
| ExpectedContextType | EMassExecutionContextType | MassEntityQuery.h | ||
| GroupSortingSteps | TArray< FArchetypeGroupingStep > | MassEntityQuery.h | ||
| LastUpdatedArchetypeDataVersion | uint32 | MassEntityQuery.h | ||
| OrderedArchetypeIndices | TArray< int32 > | MassEntityQuery.h | ||
| ValidArchetypes | TArray< FMassArchetypeHandle > | MassEntityQuery.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMassSubsystemRequirements & AddSubsystemRequirement
(
const TSubclassOf< USubsystem > SubsystemClass, |
MassEntityQuery.h | ||
FMassSubsystemRequirements & AddSubsystemRequirement
(
const TSubclassOf< USubsystem > SubsystemClass, |
MassEntityQuery.h | ||
FMassSubsystemRequirements & AddSubsystemRequirement
(
const TSubclassOf< USubsystem > SubsystemClass, |
MassEntityQuery.h | ||
FMassSubsystemRequirements & AddSubsystemRequirement
(
const EMassFragmentAccess AccessMode |
MassEntityQuery.h | ||
void CacheArchetypes
(
const FMassEntityManager& InEntityManager |
MassEntityQuery.h | ||
void CacheArchetypes () |
Will gather all archetypes from InEntityManager matching this->Requirements. | MassEntityQuery.h | |
void Clear() |
MassEntityQuery.h | ||
void ClearChunkFilter() |
MassEntityQuery.h | ||
TArray< FMassArchetypeEntityCollection > CreateMatchingEntitiesCollection() |
Creates an array of FMassArchetypeEntityCollection instances that identify all the entities currently matching this query. | MassEntityQuery.h | |
void DebugEnableEntityOwnerLogging() |
Configures the query to support per-entity logging based on their individual UObject "owners", as declared via debug fragments. | MassEntityQuery.h | |
void DirtyCachedData() |
MassEntityQuery.h | ||
bool DoesRequireGameThreadExecution() |
MassEntityQuery.h | ||
void ExportRequirements
(
FMassExecutionRequirements& OutRequirements |
MassEntityQuery.h | ||
void ForEachEntityChunk
(
FMassExecutionContext& ExecutionContext, |
Runs ExecuteFunction on entities matching Requirements up to the EntityLimit specified in the ExecutionLimiter. | MassEntityQuery.h | |
void ForEachEntityChunk
(
const FMassArchetypeEntityCollection& EntityCollection, |
MassEntityQuery.h | ||
void ForEachEntityChunk
(
FMassEntityManager& EntityManager, |
MassEntityQuery.h | ||
void ForEachEntityChunk
(
const FMassArchetypeEntityCollection& EntityCollection, |
Will first verify that the archetype given with Collection matches the query's requirements, and if so will run the other, more generic ForEachEntityChunk implementation | MassEntityQuery.h | |
void ForEachEntityChunk
(
FMassExecutionContext& ExecutionContext, |
Runs ExecuteFunction on all entities matching Requirements | MassEntityQuery.h | |
void ForEachEntityChunkInCollections
(
TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, |
MassEntityQuery.h | ||
void ForEachEntityChunkInCollections
(
TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, |
MassEntityQuery.h | ||
const TArray< FMassArchetypeHandle > & GetArchetypes() |
MassEntityQuery.h | ||
const TSharedPtr< FMassEntityManager > & GetEntityManager() |
MassEntityQuery.h | ||
TArray< FMassEntityHandle > GetMatchingEntityHandles() |
Fetches entity handles of all the entities currently matching this query. | MassEntityQuery.h | |
int32 GetNumMatchingEntities () |
Goes through ValidArchetypes and sums up the number of entities contained in them. | MassEntityQuery.h | |
int32 GetNumMatchingEntities
(
FMassEntityManager& InEntityManager |
MassEntityQuery.h | ||
int32 GetNumMatchingEntities
(
TConstArrayView< FMassArchetypeEntityCollection > EntityCollections |
Sums the entity range lengths for each collection in EntityCollections, where the collection's archetype matches the query's requirements. | MassEntityQuery.h | |
const FMassQueryRequirementIndicesMapping & GetRequirementsMappingForArchetype
(
const FMassArchetypeHandle ArchetypeHandle |
If ArchetypeHandle is among ValidArchetypes then the function retrieves requirements mapping cached for it, otherwise an empty mapping will be returned (and the requirements binding will be done the slow way). | MassEntityQuery.h | |
void GroupBy
(
UE::Mass::FArchetypeGroupType GroupType |
MassEntityQuery.h | ||
void GroupBy
(
UE::Mass::FArchetypeGroupType GroupType, |
MassEntityQuery.h | ||
bool HasChunkFilter() |
MassEntityQuery.h | ||
bool HasMatchingEntities () |
Checks if any of ValidArchetypes has any entities. | MassEntityQuery.h | |
bool HasMatchingEntities
(
FMassEntityManager& InEntityManager |
MassEntityQuery.h | ||
bool IsEmpty() |
MassEntityQuery.h | ||
bool IsGrouping() |
MassEntityQuery.h | ||
void ParallelForEachEntityChunk
(
FMassExecutionContext& ExecutionContext, |
Attempts to process every chunk of every affected archetype in parallel. | MassEntityQuery.h | |
void ParallelForEachEntityChunk
(
FMassEntityManager& EntityManager, |
MassEntityQuery.h | ||
void ParallelForEachEntityChunkInCollection
(
TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, |
MassEntityQuery.h | ||
void ParallelForEachEntityChunkInCollection
(
TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, |
MassEntityQuery.h | ||
void RegisterWithProcessor
(
UMassProcessor& Owner |
MassEntityQuery.h | ||
void RequireMutatingWorldAccess() |
MassEntityQuery.h | ||
void ResetGrouping() |
MassEntityQuery.h | ||
void SetArchetypeMatchOverride
(
const T& Override |
INLINES. | MassEntityQuery.h | |
void SetChunkFilter
(
const FMassChunkConditionFunction& InFunction |
Sets a chunk filter condition that will be applied to each chunk of all valid archetypes. | MassEntityQuery.h | |
void SetParallelCommandBufferEnabled
(
const bool bInAllowParallelCommands |
Controls whether ParallelForEachEntityChunk creates separate command buffers for each job. | MassEntityQuery.h |