Network total reforge. Team-List and Race-Data handled
This commit is contained in:
56
Source/DTFluxCore/Public/Assets/DTFluxModelAsset.h
Normal file
56
Source/DTFluxCore/Public/Assets/DTFluxModelAsset.h
Normal 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;
|
||||
};
|
||||
25
Source/DTFluxCore/Public/DTFluxCoreModule.h
Normal file
25
Source/DTFluxCore/Public/DTFluxCoreModule.h
Normal 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;
|
||||
};
|
||||
26
Source/DTFluxCore/Public/Types/Enum/DTFluxCoreEnum.h
Normal file
26
Source/DTFluxCore/Public/Types/Enum/DTFluxCoreEnum.h
Normal 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")
|
||||
};
|
||||
71
Source/DTFluxCore/Public/Types/Enum/DTFluxModelEnums.h
Normal file
71
Source/DTFluxCore/Public/Types/Enum/DTFluxModelEnums.h
Normal 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);
|
||||
@ -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;
|
||||
|
||||
|
||||
|
||||
};
|
||||
126
Source/DTFluxCore/Public/Types/Objects/DTFluxContestStorage.h
Normal file
126
Source/DTFluxCore/Public/Types/Objects/DTFluxContestStorage.h
Normal 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;
|
||||
|
||||
};
|
||||
67
Source/DTFluxCore/Public/Types/Struct/DTFluxFinishData.h
Normal file
67
Source/DTFluxCore/Public/Types/Struct/DTFluxFinishData.h
Normal 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;
|
||||
};
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
102
Source/DTFluxCore/Public/Types/Struct/DTFluxRankingStructs.h
Normal file
102
Source/DTFluxCore/Public/Types/Struct/DTFluxRankingStructs.h
Normal 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;
|
||||
|
||||
};
|
||||
129
Source/DTFluxCore/Public/Types/Struct/DTFluxTeamListStruct.h
Normal file
129
Source/DTFluxCore/Public/Types/Struct/DTFluxTeamListStruct.h
Normal 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;
|
||||
|
||||
};
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user