Navigation
API > API/Plugins > API/Plugins/MassEntity
References
| Module | MassEntity |
| Header | /Engine/Plugins/Runtime/MassEntity/Source/MassEntity/Public/MassEntityUtils.h |
| Include | #include "MassEntityUtils.h" |
namespace UE
{
namespace Mass
{
namespace Utils
{
template<typename TPred, typename TSwap>
void UE&58;&58;Mass&58;&58;Utils&58;&58;AbstractSort
&40;
const int32 NumElements,
TPred && Predicate,
TSwap && SwapFunctor
&41;
}
}
}
Remarks
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]); } );