Navigation
API > API/Runtime > API/Runtime/MassEntity
Description
AbstractSort is a sorting function that only needs to know how many items there are, how to compare items at individual locations - where location is in [0, NumElements) - and how to swap two elements at given locations. The main use case is to sort multiple arrays while keeping them in sync. For example:
TArray
AbstractSort(Lead.Num() // NumElements , &Lead // Predicate { return Lead[LHS] < Lead[RHS]; } , &Lead, &Payload // SwapFunctor { Swap(Lead[A], Lead[B]); Swap(Payload[A], Payload[B]); } );
| Name | UE::Mass::Utils::AbstractSort |
| Type | function |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassEntityUtils.h |
| Include Path | #include "MassEntityUtils.h" |
namespace UE
{
namespace Mass
{
namespace Utils
{
template<typename TPred, typename TSwap>
void UE::Mass::Utils::AbstractSort
(
const int32 NumElements,
TPred && Predicate,
TSwap && SwapFunctor
)
}
}
}