Ranking reforge. SplitRanking is not implemented yet !!!

This commit is contained in:
2025-06-30 19:02:19 +02:00
parent 81bf37639b
commit 11e695f379
13 changed files with 218 additions and 104 deletions

View File

@ -34,10 +34,13 @@ public:
TMap<FString /* ContestName */, FDTFluxContest> Contests;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
TArray<FDTFluxContestRanking> ContestRankings;
TMap<int /*ContestId*/, FDTFluxContestRankings> ContestRankings;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
TMap<FString /*ContestName*/ ,FDTFluxStageRanking> StageRankings;
TArray<FDTFluxStageRankings> StageRankings;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
TArray<FDTFluxStageRankings> SplitRankings;
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|ModelAsset")
void AddContest(const FDTFluxContest &Contest);
@ -51,6 +54,18 @@ public:
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Participant")
void AddParticipant(const FDTFluxParticipant& InParticipant, const int ContestId);
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Person")
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Person|Utils")
bool PersonExists(const FDTFluxPerson& InPerson) const;
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest|Utils")
FString GetContestNameForId(const int InContestID);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest|Utils")
bool UpdateStageRanking(const FDTFluxStageRankings& InStageRankings);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest|Utils")
bool UpdateSplitRanking(const FDTFluxStageRankings& InStageRankings);
UFUNCTION()
void AddContestRanking(const FDTFluxContestRankings& NewContestRankings);
};

View File

@ -88,13 +88,13 @@ public:
void AddSplit(const int InContest, const FDTFluxSplit& InSplit);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void AddSplitRanking(const int InContest, const FDTFluxSplitRanking& InSplitRanking);
void AddSplitRanking(const int InContest, const FDTFluxStageRanking& InSplitRanking);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetSplitRankingByParticipant(const FDTFluxParticipant& InParticipant, const int InContestId, const int InStageId, const FDTFluxSplitRanking& OutSplitRankingForBib);
void GetSplitRankingByParticipant(const FDTFluxParticipant& InParticipant, const int InContestId, const int InStageId, const FDTFluxStageRanking& OutSplitRankingForBib);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetSplitRankingByBib(const int InBib, const int InContestId, const int InStageId, const FDTFluxSplitRanking& OutSplitRankingForBib);
void GetSplitRankingByBib(const int InBib, const int InContestId, const int InStageId, const FDTFluxStageRanking& OutSplitRankingForBib);
#pragma endregion
#pragma region ParticipantSection

View File

@ -23,7 +23,7 @@ public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Bib = -1;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FDTFluxSplitRanking SplitRanking;
FDTFluxStageRanking SplitRanking;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FDTFluxStageRanking StageRanking;
};

View File

@ -23,7 +23,7 @@ public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model", EditAnywhere)
FString Name;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
TArray<FDTFluxSplitRanking> SplitRankings;
TArray<FDTFluxStageRanking> SplitRankings;
// void Dump() const;
// // void InsertOrReplace(const FDTFluxStageRankingResponseItem& SplitRankingItemResp);
// void SortByRank();

View File

@ -16,25 +16,43 @@ struct DTFLUXCORE_API FDTFluxContestRanking
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
int Bib;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
int Rank;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString Gap;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString Time;
UPROPERTY();
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere);
FString SpeedSwimAverage;
UPROPERTY();
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere);
FString SpeedRunningAverage;
UPROPERTY();
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere);
FString SpeedTotalAverage;
void Dump () const;
};
USTRUCT(BlueprintType)
struct FDTFluxContestRankings
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
TArray<FDTFluxContestRanking> Rankings;
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
int ContestId;
//TODO check if necessary ???
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
FString ContestName;
void SetName(const FString Name)
{
ContestName = Name;
}
};
/**
* @struct FDTFluxStageRanking
* Representing a stage ranking for a participant
@ -44,59 +62,48 @@ struct DTFLUXCORE_API FDTFluxStageRanking
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
int Bib;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
int Rank;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString Gap;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString Time;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString TimeSwim;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString TimeTransition;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString TimeRun;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FString TimeStart;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
FDateTime StartTime;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
float SpeedRunning;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
float SpeedTotal;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Model", VisibleAnywhere)
float SpeedSwim;
void Dump() const;
};
/**
* @struct FDTFluxSplitRanking
* Representing a ranking of a participant in a split
*/
USTRUCT(BlueprintType, Category="DTFlux|Model")
struct DTFLUXCORE_API FDTFluxSplitRanking
USTRUCT(BlueprintType)
struct FDTFluxStageRankings
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Bib;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int ContestId = 0;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int StageId = 0;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int SplitId = 0;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString Gap;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString Time;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Rank = 0;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
bool Display = false;
void Dump() const;
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
TArray<FDTFluxStageRanking> Rankings;
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
int ContestId;
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
int StageId;
UPROPERTY(BlueprintReadWrite,Category="DTFlux|Model|Ranking", VisibleAnywhere)
int SplitId;
};
};