Network total reforge. Team-List and Race-Data handled

This commit is contained in:
2025-06-29 19:04:36 +02:00
parent 3a45d4c3b7
commit 81bf37639b
92 changed files with 3736 additions and 4202 deletions

View File

@ -0,0 +1,30 @@
using UnrealBuildTool;
public class DTFluxCore : ModuleRules
{
public DTFluxCore(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core","JsonUtilities"
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"DTFluxProjectSettings",
"JsonUtilities",
"Json",
}
);
}
}

View File

@ -0,0 +1,95 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Assets/DTFluxModelAsset.h"
#include "DTFluxCoreModule.h"
#include "Types/Objects/DTFluxContestStorage.h"
// const FDateTime UDTFluxModelAsset::GetMassStart(const int& ContestId, const int& StageId)
// {
// }
// void UDTFluxModelAsset::InsertOrUpdateRaceData(const TSharedPtr<FJsonObject>& Response)
// {
//
// }
//
// void UDTFluxModelAsset::InsertOrUpdateContestRanking(const TSharedPtr<FJsonObject>& Response)
// {
// }
//
// void UDTFluxModelAsset::InsertOrUpdateStageRanking(const TSharedPtr<FJsonObject>& Response)
// {
// }
//
// void UDTFluxModelAsset::InsertOrUpdateSplitRanking(const TSharedPtr<FJsonObject>& Response)
// {
// }
//
// void UDTFluxModelAsset::InsertOrUpdateTeamList(const TSharedPtr<FJsonObject>& Response)
// {
// }
//
// void UDTFluxModelAsset::SplitSensorTriggered(const TSharedPtr<FJsonObject>& Response)
// {
// }
UDTFluxModelAsset::UDTFluxModelAsset(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}
void UDTFluxModelAsset::AddContest(const FDTFluxContest &Contest)
{
Contests.Add(Contest.Name, Contest);
}
bool UDTFluxModelAsset::GetContestById(const int InContestId, FDTFluxContest& OutContest)
{
for(auto& ContestItem : Contests)
{
if(ContestItem.Value.ContestId == InContestId)
{
OutContest = ContestItem.Value;
return true;
}
}
return false;
}
void UDTFluxModelAsset::AddPerson(const FDTFluxPerson& InPerson)
{
Persons.Add(InPerson);
}
void UDTFluxModelAsset::AddParticipant(const FDTFluxParticipant& InParticipant, const int ContestId)
{
FDTFluxContest TargetContest;
if(GetContestById(ContestId, TargetContest))
{
if(!PersonExists(InParticipant.Person1))
{
AddPerson(InParticipant.Person1);
}
if(InParticipant.Person2 != 0)
{
if(!PersonExists(InParticipant.Person2))
{
AddPerson(InParticipant.Person2);
}
}
Participants.Add(InParticipant.Bib, InParticipant);
TargetContest.ParticipantsBib.Add(InParticipant.Bib);
}
}
bool UDTFluxModelAsset::PersonExists(const FDTFluxPerson& InPerson) const
{
return Persons.ContainsByPredicate([InPerson](const FDTFluxPerson& Person)
{
return Person == InPerson;
});
}

View File

@ -0,0 +1,19 @@
#include "DTFluxCoreModule.h"
#define LOCTEXT_NAMESPACE "FDTFluxCoreModule"
DTFLUXCORE_API DEFINE_LOG_CATEGORY(logDTFluxCore);
void FDTFluxCoreModule::StartupModule()
{
}
void FDTFluxCoreModule::ShutdownModule()
{
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FDTFluxCoreModule, DTFluxCore)

View File

@ -0,0 +1,4 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Types/Objects/DTFluxContestSchedule.h"

View File

@ -0,0 +1,139 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Types/Objects/DTFluxContestStorage.h"
void UDTFluxContestStorage::Initialize()
{
}
// bool UDTFluxContestStorage::InitializeRaceData(const FDTFluxRaceDataDefinition& InRaceDataResponse)
// {
// return false;
// }
//
// bool UDTFluxContestStorage::InitializeTeamList(const FDTFluxTeamListDefinition& InTeamListDefinition)
// {
// return false;
// }
//
// bool UDTFluxContestStorage::UpdateParticipantStatus(const FDTFluxTeamListDefinition& InTeamListDefinition)
// {
// return false;
// }
#pragma region ContestRegion
const FDTFluxContest& UDTFluxContestStorage::GetCurrentContest() const
{
return CurrentContest;
}
const FDTFluxStage& UDTFluxContestStorage::GetCurrentStage(const int InContest, const int InStage)
{
return CurrentStage;
}
void UDTFluxContestStorage::AddContest(const FDTFluxContest InContest)
{
}
//
// void UDTFluxContestStorage::AddContestResponse(const FDTFluxContestResponse& InContestResponse)
// {
// }
#pragma endregion
#pragma region ContestRankingRegion
void UDTFluxContestStorage::GetContestRankings(const TArray<FDTFluxContestRanking> OutContestRanking, const int InContestId, const bool bShouldSortByRank,
const bool bShouldSkipEmpty)
{
}
void UDTFluxContestStorage::GetContestRankingsSorted(const TArray<FDTFluxContestRanking> OutSortedContestRankings, const int InContestId, const EDTFluxSortingFilter InFilter,
const bool bShouldSkipEmpty)
{
}
#pragma endregion
#pragma region StageRegion
void UDTFluxContestStorage::GetStage(const int InContest, const int InStage, const FDTFluxStage& OutStage)
{
}
void UDTFluxContestStorage::GetStages(const int InContest, TArray<FDTFluxStage> OutStages)
{
}
void UDTFluxContestStorage::GetStageCurrentStage(const FDTFluxStage& OutStage)
{
}
void UDTFluxContestStorage::AddStage(const int InContest, const FDTFluxStage& InStage)
{
}
// void UDTFluxContestStorage::AddStageResponse(const int InContestId, const FDTFluxStageResponse& StageResponse)
// {
// }
#pragma endregion
#pragma region StageRankingRegion
void UDTFluxContestStorage::AddStageRanking(const int InContest, const FDTFluxStageRanking& InStageRanking)
{
}
#pragma endregion
#pragma region SplitRegion
void UDTFluxContestStorage::AddSplit(const int InContest, const FDTFluxSplit& InSplit)
{
}
#pragma endregion
#pragma region SplitRankingRegion
void UDTFluxContestStorage::AddSplitRanking(const int InContest, const FDTFluxSplitRanking& InSplitRanking)
{
}
void UDTFluxContestStorage::GetSplitRankingByParticipant(const FDTFluxParticipant& InParticipant, const int InContestId,
const int InStageId, const FDTFluxSplitRanking& OutSplitRankingForBib)
{
}
void UDTFluxContestStorage::GetSplitRankingByBib(const int InBib, const int InContestId, const int InStageId,
const FDTFluxSplitRanking& OutSplitRankingForBib)
{
}
#pragma endregion
#pragma region ParticipantSection
void UDTFluxContestStorage::GetParticipantsForContest(const int InContestId,
const TArray<FDTFluxParticipant> OutParticipants)
{
}
void UDTFluxContestStorage::GetPoursuiteStartupLine(const int InContestId,
const TArray<FDTFluxParticipant> OutParticipants)
{
}
FDateTime UDTFluxContestStorage::GetMassStart(const int InContestId)
{
return FDateTime();
}
#pragma endregion
void UDTFluxContestStorage::SetCurrentContest()
{
}

View File

@ -0,0 +1,3 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Types/Struct/DTFluxRaceDataStructs.h"

View File

@ -0,0 +1,29 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Types/Struct/DTFluxRankingStructs.h"
#include "DTFluxCoreModule.h"
void FDTFluxContestRanking::Dump() const
{
UE_LOG(logDTFluxCore, Log,
TEXT("FDTFluxContestRanking ->> \n \"rank\" : %d, Participant with Bib %d \"Gap\" : %s, \"Time\" : %s "),
Rank, Bib, *Gap, *Time );
};
void FDTFluxStageRanking::Dump() const
{
UE_LOG(logDTFluxCore, Log, TEXT("RANKING : %02d. Participant bib %d %s %s %s %s %s"),
Rank, Bib, *Gap, *TimeSwim,
*TimeTransition, *TimeRun, *StartTime.ToString());
}
void FDTFluxSplitRanking::Dump() const
{
UE_LOG(logDTFluxCore, Log, TEXT("SplitGapItem"))
// Participant.Dump();
UE_LOG(logDTFluxCore, Log, TEXT("Bib %02d Rank %02d Gap %s Time %s"), Bib, Rank, *Gap, *Time);
}

View File

@ -0,0 +1,107 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Types/Struct/DTFluxTeamListStruct.h"
bool FDTFluxParticipant::IsTeam() const
{
return Person2.FirstName.IsEmpty() && Person2.LastName.IsEmpty();
}
void FDTFluxParticipant::Dump() const
{
FString EliteStr = "NO";
if(Elite)
{
EliteStr = "YES";
}
UE_LOG(logDTFluxCore, Log, TEXT("PARTICIPANT with bib: %03d"), Bib);
UE_LOG(logDTFluxCore, Log, TEXT("Fullname : %s %s"), *Person1.FirstName, *Person1.LastName);
if(IsTeam())
{
UE_LOG(logDTFluxCore, Log, TEXT("Teamate : %s %s"), *Person2.FirstName, *Person2.LastName);
UE_LOG(logDTFluxCore, Log, TEXT("Team name : %s"), *Team);
}
UE_LOG(logDTFluxCore, Log, TEXT("Club : %s, Category : %s, IsElite : %s, Status : %s"),
*Club, *Category, *EliteStr, *UEnum::GetValueAsString(Status));
}
FString FDTFluxParticipant::GetParticipantFormatedName(bool Truncate, int MaxSize) const
{
FString ParticipantName;
if(Truncate)
{
if(IsTeam())
{
//Concatenate the team name;
if(Team.Len() > MaxSize - 3)
{
return Team.Left(MaxSize - 3).Append(TEXT("..."));
}
return Team;
}
if(Person1.FirstName.Contains("-") )
{
FString Formated = "";
//Compound Firstname
TArray<FString> Out;
Person1.FirstName.ParseIntoArray(Out,TEXT("-"),true);
for(const auto& Str : Out)
{
Formated.Append(Str.Left(1).ToUpper()).Append(".");
}
// TODO : Camel Case handling for LastName
Formated.Append(" ").Append(*Person1.LastName);
UE_LOG(logDTFluxCore, Log, TEXT("Firstname is with space compound. Formated Name %s length %02d MAX Size : %02d"),
*Formated, Formated.Len(), MaxSize);
if(Formated.Len() >= MaxSize)
{
UE_LOG(logDTFluxCore, Log, TEXT("Reducing %s Formated"), *Formated);
return Formated.Left(MaxSize - 3).Append("...");
}
return Formated;
}
if(Person1.FirstName.Contains(" "))
{
FString Formated = "";
//Compound Firstname
TArray<FString> Out;
Person1.FirstName.ParseIntoArray(Out,TEXT(" "),true);
for(const auto& Str : Out)
{
Formated.Append(Str.Left(1).ToUpper()).Append(".");
}
// TODO : Camel Case handling for LastName
Formated.Append(" ").Append(*Person1.LastName);
UE_LOG(logDTFluxCore, Log, TEXT("Firstname is with space compound. Formated Name %s length %02d MAX Size : %02d"),
*Formated, Formated.Len(), MaxSize);
if(Formated.Len() >= MaxSize)
{
UE_LOG(logDTFluxCore, Log, TEXT("Reducing %s Formated"), *Formated);
return Formated.Left(MaxSize - 3).Append("...");
}
return Formated;
}
FString Formated = Person1.FirstName.Left(1).Append(". ");
Formated.Append(Person1.LastName);
UE_LOG(logDTFluxCore, Log, TEXT("Firstname is not compound. Formated Name %s length %02d MAX Size : %02d"),
*Formated, Formated.Len(), MaxSize);
if(Formated.Len() >= MaxSize)
{
UE_LOG(logDTFluxCore, Log, TEXT("Reducing %s Formated"), *Formated);
return Formated.Left(MaxSize - 3).Append("...");
}
return Formated;
}
else
{
if(!IsTeam())
{
return FString::Printf(TEXT("%s %s"), *Person1.FirstName, *Person2.LastName);
}
return Team;
}
}

View File

@ -0,0 +1,9 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Types/Struct/FDTFluxPoursuiteStruct.h"
FText FDTFluxPoursuite::GetParticipantFormatedName() const
{
return FText();
}

View File

@ -0,0 +1,56 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "Dom/JsonObject.h"
#include "Types/Struct/DTFluxRaceDataStructs.h"
#include "DTFluxModelAsset.generated.h"
class UDTFluxContestStorage;
/**
* Class representing Data Storage
*/
UCLASS(BlueprintType)
class DTFLUXCORE_API UDTFluxModelAsset : public UObject
{
GENERATED_BODY()
UDTFluxModelAsset(const FObjectInitializer& ObjectInitializer);
public:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString EventName = "MyEvent";
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<FDTFluxPerson> Persons;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TMap<int /* Bib */, FDTFluxParticipant> Participants;
UPROPERTY(BlueprintReadOnly, EditAnywhere)
TMap<FString /* ContestName */, FDTFluxContest> Contests;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
TArray<FDTFluxContestRanking> ContestRankings;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
TMap<FString /*ContestName*/ ,FDTFluxStageRanking> StageRankings;
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|ModelAsset")
void AddContest(const FDTFluxContest &Contest);
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Contest")
bool GetContestById(const int InContestId, FDTFluxContest& OutContest);
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Person")
void AddPerson(const FDTFluxPerson& InPerson);
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Participant")
void AddParticipant(const FDTFluxParticipant& InParticipant, const int ContestId);
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Person")
bool PersonExists(const FDTFluxPerson& InPerson) const;
};

View File

@ -0,0 +1,25 @@
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
/**
* @module DTFluxCoreModule
* @details DTFlux Project is a framework to integrate all kind of events data from
* multiple API (stopwatch servers, etc...) or manually to unreal motion design platform
* to create live audiovisual shows.
* @brief This module provides all necessary basic class to set up your communication
* between an external APIs and unreal engine.
* @license See LICENSE.TXT at the of DTFluxAPI plugin folder or at
* @see https://github.com/A2MSystemes/DTFluxAPI/blob/main/LICENSE
* @author Ange-Marie MAURIN
*/
DTFLUXCORE_API DECLARE_LOG_CATEGORY_EXTERN(logDTFluxCore, Log, All);
class DTFLUXCORE_API FDTFluxCoreModule : public IModuleInterface
{
public:
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};

View File

@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
UENUM(BlueprintType)
enum class EDTFluxRequestType : uint8
{
None = 0 UMETA(DisplayName="None"),
ContestRanking = 1 UMETA(DisplayName="contest-ranking"),
StageRanking = 2 UMETA(DisplayName="stage-ranking"),
SplitRanking = 3 UMETA(DisplayName="split-ranking"),
TeamList = 4 UMETA(DisplayName="team-list"),
RaceData = 5 UMETA(DisplayName="race-data"),
};
UENUM(BlueprintType)
enum class EDTFluxConnectionStatus : uint8
{
Unset = 0 UMETA(DisplayName="Unset"),
Connected = 1 << 0 UMETA(DisplayName="Connected"),
Error = 2 << 1 UMETA(DisplayName="Error")
};

View File

@ -0,0 +1,71 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "DTFluxModelEnums.generated.h"
/**
*
*/
UENUM(BlueprintType, Category="DTFlux|Model")
enum class EDTFluxParticipantStatusType : uint8
{
Normal = 0 UMETA(DisplayName="Normal"),
OutOfRace = 1 UMETA(DisplayName="HorsCourse"),
DSQ = 2 UMETA(DisplayName="Disqualifié"),
DNF = 3 UMETA(DisplayName="Abandon"),
DNS = 4 UMETA(DisplayName="NonPartant"),
NotLinedUp = 5 UMETA(DisplayName="NonPresentAuDépart"),
};
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
enum class EParticipantSortingType : uint8
{
None = 0 << 1 UMETA(DisplayName="Normal"),
Alpha = 1 << 1 UMETA(DisplayName="Aplha"),
PoursuiteStartTime = 1 << 2 UMETA(DisplayName="Poursuite StartTime"),
Rank = 1 << 3 UMETA(DisplayName="Rank"),
IgnoreEmpty = 1 << 4 UMETA(DisplayName="IgnoreEmpty"),
};
ENUM_CLASS_FLAGS(EParticipantSortingType);
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
enum class EDTFluxFinisherType : uint8
{
None = 0b0000000 UMETA(DisplayName="Unknown"),
Finish = 0b0000001 UMETA(DisplayName="Finish"),
Winner = 0b0000010 UMETA(DisplayName="Winner"),
Spotter = 0b0000100 UMETA(DisplayName="Spotter"),
};
ENUM_CLASS_FLAGS(EDTFluxFinisherType);
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
enum class EDTFluxSplitType : uint8
{
None = 0b00000000 UMETA(DisplayName="Undefined"),
PreFinnish = 0b00000001 UMETA(DisplayName="PreFinnishSplit"),
Finish = 0b00000010 UMETA(DisplayName="FinishSplit"),
Regular = 0b00000100 UMETA(DisplayName="Regular"),
};
ENUM_CLASS_FLAGS(EDTFluxSplitType);
UENUM(BlueprintType, meta=(Bitflags, UseEnumValuesAsMaskValuesInEditor=true))
enum EDTFluxSortingFilter : uint8
{
None = 0b00000000 UMETA(DisplayName="No Sorting"),
IgnoreStatusOut = 0b00000001 UMETA(DisplayName="IgnoreStatusOut"),
Ascending = 0b00000010 UMETA(DisplayName="Ascending"),
Descending = 0b00000100 UMETA(DisplayName="Descending"),
IgnoreEmpty = 0b00001000 UMETA(DisplayName="IgnoreEmpty"),
ByRank = 0b00010000 UMETA(DisplayName="ByRank"),
ByAlpha = 0b01000000 UMETA(DisplayName="ByAlpha"),
ByStartTime = 0b00100000 UMETA(DisplayName="ByStartTime"),
AscendingByRank = Ascending | ByRank UMETA(DisplayName="AscendingByRank"),
DescendingByRank= Descending | ByRank UMETA(DisplayName="DescendingByRank")
};
ENUM_CLASS_FLAGS(EDTFluxSortingFilter);

View File

@ -0,0 +1,89 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxContestSchedule.generated.h"
/**
*
*/
UCLASS(Blueprintable)
class DTFLUXCORE_API UDTFluxParticipantSchedule : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString FirstName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString LastName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString FirstName2;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString LastName2;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int Bib;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool Elite = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString Club;
};
/**
*
*/
UCLASS(Blueprintable)
class DTFLUXCORE_API UDTFluxStageSchedule : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
uint8 StageId;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString StageName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FDateTime StartTime;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FDateTime EndTime;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FDateTime CutOff;
};
/**
*
*/
UCLASS(Blueprintable)
class DTFLUXCORE_API UDTFluxContestSchedule : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
uint8 ContestId;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FDateTime Date;
};

View File

@ -0,0 +1,126 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "Types/Struct/DTFluxRaceDataStructs.h"
#include "DTFluxContestStorage.generated.h"
/**
*
*/
UCLASS(BlueprintType)
class DTFLUXCORE_API UDTFluxContestStorage : public UObject
{
GENERATED_BODY()
public:
UFUNCTION()
void Initialize();
UPROPERTY()
bool bInitialize = false;
// UFUNCTION()
// bool InitializeRaceData(const FDTFluxRaceDataDefinition& InRaceDataDefinition);
//
// UFUNCTION()
// bool InitializeTeamList(const FDTFluxTeamListDefinition& InTeamListDefinition);
//
// UFUNCTION()
// bool UpdateParticipantStatus(const FDTFluxTeamListDefinition& InTeamListDefinition);
#pragma region EventsSection
#pragma endregion
#pragma region ContestRegion
UPROPERTY()
TArray<FDTFluxContest> ContestsStore;
UPROPERTY()
TMap<int /*Bib*/,FDTFluxContestRanking /*Ranking*/> ContestRankingStore;
UFUNCTION(BlueprintPure, BlueprintCallable, Category="DTFlux|Contest")
const FDTFluxContest& GetCurrentContest() const;
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
const FDTFluxStage& GetCurrentStage(const int InContest, const int InStage);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetContestRankings(const TArray<FDTFluxContestRanking> OutContestRanking, const int InContestId, const bool bShouldSortByRank = true, const bool bShouldSkipEmpty = true);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetContestRankingsSorted( const TArray<FDTFluxContestRanking> OutSortedContestRankings, const int InContestId, const EDTFluxSortingFilter InFilter, const bool bShouldSkipEmpty = true );
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void AddContest(const FDTFluxContest InContest);
//
// UFUNCTION(Category="DTFlux|Contest")
// void AddContestResponse(const FDTFluxContestResponse& InContestResponse);
#pragma endregion
#pragma region StageSection
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetStage(const int InContest, const int InStage, const FDTFluxStage& OutStage);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetStages(const int InContest, TArray<FDTFluxStage> OutStages);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetStageCurrentStage(const FDTFluxStage& OutStage);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void AddStage(const int InContest, const FDTFluxStage& InStage);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void AddStageRanking(const int InContest, const FDTFluxStageRanking& InStageRanking);
// UFUNCTION(Category="DTFlux|Contest")
// void AddStageResponse(const int InContestId, const FDTFluxStageResponse& StageResponse);
#pragma endregion
#pragma region SplitSection
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void AddSplit(const int InContest, const FDTFluxSplit& InSplit);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void AddSplitRanking(const int InContest, const FDTFluxSplitRanking& InSplitRanking);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetSplitRankingByParticipant(const FDTFluxParticipant& InParticipant, const int InContestId, const int InStageId, const FDTFluxSplitRanking& OutSplitRankingForBib);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetSplitRankingByBib(const int InBib, const int InContestId, const int InStageId, const FDTFluxSplitRanking& OutSplitRankingForBib);
#pragma endregion
#pragma region ParticipantSection
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetParticipantsForContest(const int InContestId, const TArray<FDTFluxParticipant> OutParticipants);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
void GetPoursuiteStartupLine(const int InContestId, const TArray<FDTFluxParticipant> OutParticipants);
UFUNCTION(BlueprintCallable, Category="DTFlux|Contest")
FDateTime GetMassStart(const int InContestId );
#pragma endregion
protected:
UFUNCTION()
void SetCurrentContest();
private:
UPROPERTY()
FDTFluxContest CurrentContest;
UPROPERTY()
FDTFluxStage CurrentStage;
};

View File

@ -0,0 +1,67 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "DTFluxCoreModule.h"
#include "DTFluxRankingStructs.h"
#include "UObject/Object.h"
#include "DTFluxTeamListStruct.h"
#include "DTFluxFinishData.generated.h"
USTRUCT(BlueprintType, Category="DTFlux|Model")
// ReSharper disable once IdentifierTypo
struct DTFLUXCORE_API FDTFluxFinisherData
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int ContestId;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int StageId;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Bib = -1;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FDTFluxSplitRanking SplitRanking;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FDTFluxStageRanking StageRanking;
};
USTRUCT(BlueprintType, Category="FDTFlux|Model")
struct DTFLUXCORE_API FDTFluxFinisher
{
GENERATED_BODY()
UPROPERTY(BlueprintReadOnly, Category="FDTFlux|Model")
EDTFluxFinisherType Type;
UPROPERTY(BlueprintReadOnly, Category="FDTFlux|Model")
FDTFluxParticipant Participant;
UPROPERTY(BlueprintReadOnly, Category="FDTFlux|Model")
FDTFluxStageRanking CurrentRanking;
};
USTRUCT(BlueprintType, Category="DTFlux|Subsystem|Events")
struct DTFLUXCORE_API FDTFluxStageFinished
{
GENERATED_BODY()
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
int ContestId = 0;
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
int StageId = 0;
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
TArray<FDTFluxStageRanking> Rankings;
};
USTRUCT(BlueprintType, Category="DTFlux|Subsystem|Events")
struct DTFLUXCORE_API FDTFluxContestFinished
{
GENERATED_BODY()
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
int ContestId = 0;
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
TArray<FDTFluxStageRanking> Rankings;
};

View File

@ -0,0 +1,90 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "DTFluxRankingStructs.h"
#include "DTFluxTeamListStruct.h"
#include "UObject/Object.h"
#include "DTFluxRaceDataStructs.generated.h"
/**
* Struct representing a Split data
* Used to exchange data between other objects in the system
*/
USTRUCT(BlueprintType, Category="DTFlux|RaceData")
struct DTFLUXCORE_API FDTFluxSplit
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model", EditAnywhere)
int SplitId = -1;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model", EditAnywhere)
FString Name;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
TArray<FDTFluxSplitRanking> SplitRankings;
// void Dump() const;
// // void InsertOrReplace(const FDTFluxStageRankingResponseItem& SplitRankingItemResp);
// void SortByRank();
// TArray<FDTFluxSplitRanking> GetSplitRanking(const int From = 0, const int DisplayNumber = 0);
};
/**
* Struct representing Stage data
* Used to exchange data between other objects in the system
*/
USTRUCT(BlueprintType, Category="DTFlux|RaceData")
struct DTFLUXCORE_API FDTFluxStage
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
int StageId;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString Name;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FDateTime StartTime;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FDateTime EndTime;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FDateTime CutOff;
};
/**
* Struct representing Contest data
* Used to exchange data between other objects in the system
*/
USTRUCT(BlueprintType, Category="DTFlux|RaceData")
struct DTFLUXCORE_API FDTFluxContest
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
int ContestId = -1;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString Name;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
TArray<int> ParticipantsBib;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
TArray<FDTFluxStage> Stages;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
TArray<FDTFluxSplit> Splits;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FDateTime Date;
};
USTRUCT()
struct DTFLUXCORE_API FDTFluxRaceData
{
GENERATED_BODY()
public:
UPROPERTY()
// ReSharper disable once IdentifierTypo
TArray<FDTFluxContest> Datas;
};

View File

@ -0,0 +1,102 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxRankingStructs.generated.h"
/**
* @struct FDTFluxContestRanking
* Representing a contest ranking for a participant
*/
USTRUCT(BlueprintType, Category="DTFlux|Model")
struct DTFLUXCORE_API FDTFluxContestRanking
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Bib;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Rank;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString Gap;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString Time;
UPROPERTY();
FString SpeedSwimAverage;
UPROPERTY();
FString SpeedRunningAverage;
UPROPERTY();
FString SpeedTotalAverage;
void Dump () const;
};
/**
* @struct FDTFluxStageRanking
* Representing a stage ranking for a participant
*/
USTRUCT(BlueprintType, Category="DTFlux|Model")
struct DTFLUXCORE_API FDTFluxStageRanking
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Bib;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
int Rank;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString Gap;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString Time;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString TimeSwim;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString TimeTransition;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString TimeRun;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FString TimeStart;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
FDateTime StartTime;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
float SpeedRunning;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
float SpeedTotal;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
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
{
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;
};

View File

@ -0,0 +1,129 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxCoreModule.h"
#include "Types/Enum/DTFluxModelEnums.h"
#include "DTFluxTeamListStruct.generated.h"
USTRUCT()
struct DTFLUXCORE_API FDTFluxTeamListItemDefinition
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "team-list-item";
UPROPERTY()
int ContestId;
UPROPERTY()
int Bib;
UPROPERTY()
FString FirstName;
UPROPERTY()
FString LastName;
UPROPERTY()
FString FirstName2 = "";
UPROPERTY()
FString LastName2 = "";
UPROPERTY()
FString Team = "";
UPROPERTY()
FString Gender;
UPROPERTY()
FString Gender2;
UPROPERTY()
bool Elite;
UPROPERTY()
FString Category;
UPROPERTY()
int Status;
UPROPERTY()
FString Club;
};
/**
* @struct FDTFluxTeamListDefinition
* Struct representing the Participant List definition
* Used to exchange data between Objects in the system
*/
USTRUCT(BlueprintType)
struct DTFLUXCORE_API FDTFluxTeamListDefinition
{
GENERATED_BODY()
public:
UPROPERTY()
// ReSharper disable once IdentifierTypo
TArray<FDTFluxTeamListItemDefinition> Datas;
};
USTRUCT(BlueprintType, Category="DTFlux|Model")
struct DTFLUXCORE_API FDTFluxPerson
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString FirstName;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString LastName;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString Gender;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString FunctionLine1 = TEXT("");
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString FunctionLine2 = TEXT("");
bool operator==(const FDTFluxPerson& Right) const
{
return FirstName.ToLower() + LastName.ToLower() + Gender.ToLower()
== Right.FirstName.ToLower() + Right.LastName.ToLower() + Right.Gender.ToLower();
}
bool operator==(const int Length) const
{
return (FirstName.ToLower() + LastName.ToLower() + Gender.ToLower()).Len() == Length;
}
bool operator!=(const int Length) const
{
return !(*this == Length);
}
bool operator!=(const FDTFluxPerson& Right) const
{
return FirstName.ToLower() + LastName.ToLower() + Gender.ToLower()
!= Right.FirstName.ToLower() + Right.LastName.ToLower() + Right.Gender.ToLower();
}
};
USTRUCT(BlueprintType, Category="DTFlux|Model")
struct DTFLUXCORE_API FDTFluxParticipant
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
int Bib = -1;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FDTFluxPerson Person1;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FDTFluxPerson Person2;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString Category;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString Club;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
bool Elite;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
EDTFluxParticipantStatusType Status;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
FString Team;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
bool bIsMassStartParticipant = false;
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model")
int LastSplitId = 0;
bool IsTeam() const;
void Dump() const;
FString GetParticipantFormatedName(bool Truncate = false, int MaxSize = 20) const;
};

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "DTFluxTeamListStruct.h"
#include "UObject/Object.h"
#include "FDTFluxPoursuiteStruct.generated.h"
/**
* @struct FDTFluxPoursuite
* Representing a
*/
USTRUCT(BlueprintType, Category="DTFlux|Poursuite")
struct FDTFluxPoursuite
{
GENERATED_BODY()
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Poursuite")
FDTFluxParticipant Participant;
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Poursuite")
FDateTime TimeStart;
FText GetParticipantFormatedName() const;
};