// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "DTFluxCore/Public/Types/Struct/DTFluxTeamListStruct.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "Types/Struct/DTFluxSplitSensor.h" #include "DTFluxUtils.generated.h" /** * */ UCLASS() class DTFLUXUTILITIES_API UFTDFluxUtils : public UBlueprintFunctionLibrary { GENERATED_BODY() public: UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="name, concat, participant")) static FText GetFormatedName(const int& Bib, const int MaxChar = 10, const FString Separator = ".", const FString OverFlowChar = "..."); UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="name, concat, participant")) static FText GetParticipantFormatedName(FDTFluxParticipant& Participant, const int MaxChar = 10, const FString Separator = ".", const FString OverFlowChar = "..."); UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="convert, StageRankings, DTFlux")) static void CastToDTFluxStageRanking(const FDTFluxDetailedRankingItem& ItemRanking, FDTFluxStageRanking& OutRanking) { CastRankingItem(ItemRanking, OutRanking); } UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="convert, StageRankings, DTFlux")) static void CastToDTFluxStageRankingArray(const TArray& ItemRanking, TArray& OutRanking) { CastRankingArray(ItemRanking, OutRanking); } UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="convert, StageRankings, DTFlux")) static void CastToDTFluxSplitRanking(const FDTFluxDetailedRankingItem& ItemRanking, FDTFluxSplitRanking& OutRanking) { CastRankingItem(ItemRanking, OutRanking); } UFUNCTION(BlueprintCallable, Category="DTFlux|Utils", Meta=(Keywords="convert, StageRankings, DTFlux")) static void CastToDTFluxSplitRankingArray(const TArray& ItemRanking, TArray& OutRanking) { CastRankingArray(ItemRanking, OutRanking); } template static void CastRankingItem(const FDTFluxDetailedRankingItem& ItemRanking, T& OutRanking) { OutRanking = static_cast(ItemRanking); } template static void CastRankingArray(const TArray& ItemRanking, TArray& OutRanking) { OutRanking.Empty(); for (auto& Item : ItemRanking) { OutRanking.Add(static_cast(Item)); } } UFUNCTION(BlueprintCallable, Category="DTFlux|Utils") static void GetFullName(const int Bib, FText& OutFullName); UFUNCTION(BlueprintCallable, Category="DTFlux|Utils") static TArray SortSplitRankingsByRank(const TArray& Rankings); };