Navigation
API > API/Runtime > API/Runtime/MassEntity
Stores a lambda to execute at flush time. Maximum flexibility, no type safety. The OpType template parameter controls execution ordering relative to other commands. Multiple lambdas of the same OpType batch into a single command instance.
When to use: as a last resort when no typed command fits the use case, or for complex multi-step operations that can't be expressed as a single composition change. Prefer typed commands (AddElements, RemoveElements, etc.) when possible.
Example: Context.Defer().PushCommand
Variants (by execution order): FMassDeferredCreateCommand, FMassDeferredAddCommand, FMassDeferredRemoveCommand, FMassDeferredChangeCompositionCommand, FMassDeferredSetCommand, FMassDeferredDestroyCommand.
Breakpoint support: No. No type safety. No validation.
| Name | FMassDeferredCommand |
| Type | struct |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassCommands.h |
| Include Path | #include "MassCommands.h" |
Syntax
template<EMassCommandOperationType OpType>
struct FMassDeferredCommand : public FMassBatchedCommand
Inheritance Hierarchy
- FMassBatchedCommand → FMassDeferredCommand
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMassDeferredCommand() |
MassCommands.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FExecFunction | TFunction< void(FMassEntityManager &EntityManager)> | MassCommands.h | |
| Super | FMassBatchedCommand | MassCommands.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Add
(
FExecFunction&& ExecFunction |
MassCommands.h | ||
void Add
(
const FExecFunction& ExecFunction |
MassCommands.h |
Protected Virtual
Overridden from FMassBatchedCommand
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual SIZE_T GetAllocatedSize() |
MassCommands.h | ||
virtual void Reset() |
MassCommands.h | ||
virtual void Run
(
FMassEntityManager& EntityManager |
MassCommands.h |