Navigation
API > API/Plugins > API/Plugins/MassEntity
Inheritance Hierarchy
- FMassFragmentRequirements
- FMassSubsystemRequirements
- FMassEntityQuery
References
| Module | MassEntity |
| Header | /Engine/Plugins/Runtime/MassEntity/Source/MassEntity/Public/MassEntityQuery.h |
| Include | #include "MassEntityQuery.h" |
Syntax
USTRUCT&40;&41;
struct FMassEntityQuery :
public FMassFragmentRequirements,
public FMassSubsystemRequirements
Remarks
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.
Constructors
| Type | Name | Description | |
|---|---|---|---|
FMassEntityQuery
(
std::initializer_list< UScriptStruct* > InitList |
|||
FMassEntityQuery
(
TConstArrayView< const UScriptStruct* > InitList |
|||
FMassEntityQuery
(
UMassProcessor& Owner |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | CacheArchetypes
(
const FMassEntityManager& InEntityManager |
Will gather all archetypes from InEntityManager matching this->Requirements. | |
| void | Clear () |
||
| void | |||
| void | |||
| bool | |||
| void | ExportRequirements
(
FMassExecutionRequirements& OutRequirements |
||
| void | ForEachEntityChunk
(
const FMassArchetypeEntityCollection& Collection, |
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 | |
| void | ForEachEntityChunk
(
FMassEntityManager& EntityManager, |
Runs ExecuteFunction on all entities matching Requirements | |
| const TArray< FMassArchetypeHandle > & | |||
| int32 | GetNumMatchingEntities
(
FMassEntityManager& InEntityManager |
Goes through ValidArchetypes and sums up the number of entities contained in them. | |
| 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). | |
| bool | |||
| bool | HasMatchingEntities
(
FMassEntityManager& InEntityManager |
Checks if any of ValidArchetypes has any entities. | |
| void | |||
| void | RegisterWithProcessor
(
UMassProcessor& Owner |
||
| void | |||
| void | SetChunkFilter
(
const FMassChunkConditionFunction& InFunction |
Sets a chunk filter condition that will applied to each chunk of all valid archetypes. |