From f19503a3b7377705b7f132ddd4ffe761eb61c40d Mon Sep 17 00:00:00 2001 From: Ange-Marie MAURIN Date: Fri, 19 Jul 2024 12:33:08 +0200 Subject: [PATCH] Added Sorting SplitRanking By Rank Helper --- Source/DTFluxAPI/Private/DTFluxUtils/DTFluxUtils.cpp | 9 +++++++++ Source/DTFluxAPI/Public/DTFluxUtils/DTFluxUtils.h | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/DTFluxAPI/Private/DTFluxUtils/DTFluxUtils.cpp b/Source/DTFluxAPI/Private/DTFluxUtils/DTFluxUtils.cpp index fb651e5..7f4c2ff 100644 --- a/Source/DTFluxAPI/Private/DTFluxUtils/DTFluxUtils.cpp +++ b/Source/DTFluxAPI/Private/DTFluxUtils/DTFluxUtils.cpp @@ -83,3 +83,12 @@ FString UDTFluxModelHelper::GetCurrentStageName(UDTFluxDataStorage* DataStorage) } return Name; } + +void UDTFluxModelHelper::SortByRank(TArray& SplitRankingArray) +{ + + SplitRankingArray.Sort([](const FDTFluxSplitRanking A, const FDTFluxSplitRanking B ) + { + return A.Rank < B.Rank; + }); +} diff --git a/Source/DTFluxAPI/Public/DTFluxUtils/DTFluxUtils.h b/Source/DTFluxAPI/Public/DTFluxUtils/DTFluxUtils.h index a10790b..0305c24 100644 --- a/Source/DTFluxAPI/Public/DTFluxUtils/DTFluxUtils.h +++ b/Source/DTFluxAPI/Public/DTFluxUtils/DTFluxUtils.h @@ -129,6 +129,8 @@ public: UFUNCTION(BlueprintCallable, Category="DTFlux|Model|Helpers") static FString GetCurrentStageName(UDTFluxDataStorage* DataStorage); - + + UFUNCTION(BlueprintCallable, Category="DTFlux|Model|Helpers") + static void SortByRank(TArray& SplitRankingArray); };