Added Tracking Mechanism for Participant
This commit is contained in:
@ -44,6 +44,15 @@ public:
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TMap<FDTFluxSplitKey, FDTFluxSplitRankings> SplitRankings;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TMap<FDTFluxSplitSensorKey, FDTFluxSplitSensorInfo> SplitSensorInfoCache;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TMap<int /*ContestId*/, int /*SplitId*/> LastSplitIdCache;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TMap<int/*ContestId*/, int /*Penultimate*/>PenultimateSplitIdCache;
|
||||
|
||||
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|ModelAsset")
|
||||
void AddContest(const FDTFluxContest& Contest);
|
||||
|
||||
@ -92,6 +101,8 @@ public:
|
||||
|
||||
UFUNCTION()
|
||||
bool IsStageFinished(FDTFluxStageKey StageKey);
|
||||
UFUNCTION()
|
||||
void CacheSplitSensorInfo(const FDTFluxSplitSensorKey SplitSensorKey, const FDTFluxSplitSensorInfo& SplitSensorInfo);
|
||||
|
||||
private:
|
||||
UPROPERTY()
|
||||
|
||||
@ -109,3 +109,61 @@ struct DTFLUXCORE_API FDTFluxSplitKey : public FDTFluxCompositeKey
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct DTFLUXCORE_API FDTFluxSplitSensorKey : public FDTFluxCompositeKey
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
FDTFluxSplitSensorKey() = default;
|
||||
|
||||
FDTFluxSplitSensorKey(const int InContestId, const int InStageId, const int InSplitId, const int InBib) :
|
||||
ContestId(InContestId),
|
||||
StageId(InStageId),
|
||||
SplitId(InSplitId),
|
||||
Bib(InBib){};
|
||||
|
||||
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="DTFlux|Model")
|
||||
int ContestId = 0;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="DTFlux|Model")
|
||||
int StageId = 0;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="DTFlux|Model")
|
||||
int SplitId = 0;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="DTFlux|Model")
|
||||
int Bib = 0;
|
||||
|
||||
|
||||
friend uint32 GetTypeHash(const FDTFluxSplitSensorKey& Key)
|
||||
{
|
||||
return HashCombine(
|
||||
GetTypeHash(Key.ContestId),
|
||||
GetTypeHash(Key.StageId),
|
||||
GetTypeHash(Key.SplitId),
|
||||
GetTypeHash(Key.Bib)
|
||||
);
|
||||
}
|
||||
|
||||
bool operator==(const FDTFluxSplitSensorKey& Other) const
|
||||
{
|
||||
return ContestId == Other.ContestId && StageId == Other.StageId
|
||||
&& SplitId == Other.SplitId && Bib == Other.Bib;
|
||||
}
|
||||
|
||||
FString GetDisplayName() const
|
||||
{
|
||||
return FString::Printf(TEXT("Contest%i | Stage%i | Split%i | Bib%i"), ContestId, StageId, SplitId, Bib);
|
||||
}
|
||||
|
||||
FText GetTooltipText() const
|
||||
{
|
||||
return FText::Format(INVTEXT("Contest{0}|Stage{1}|Split{2}"),
|
||||
FText::AsNumber(ContestId),
|
||||
FText::AsNumber(StageId),
|
||||
FText::AsNumber(SplitId),
|
||||
FText::AsNumber(Bib)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -17,7 +17,17 @@ struct FDTFluxSplitSensorInfo
|
||||
|
||||
public:
|
||||
FDTFluxSplitSensorInfo() = default;
|
||||
|
||||
FDTFluxSplitSensorInfo(const FString InSplitName):
|
||||
Bib(-1),
|
||||
ContestId(-1),
|
||||
StageId(-1),
|
||||
SplitId(-1),
|
||||
Time(""),
|
||||
Gap("-"),
|
||||
Rank(-1),
|
||||
SplitName(InSplitName)
|
||||
{
|
||||
};
|
||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||
int Bib = -1;
|
||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||
@ -32,4 +42,22 @@ public:
|
||||
FString Gap = "-";
|
||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||
int Rank = -1;
|
||||
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
||||
FString SplitName = "";
|
||||
};
|
||||
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FDTFluxSplitHistory
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
FDTFluxSplitHistory() = default;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
FDTFluxParticipant Participant = FDTFluxParticipant();
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TArray<FDTFluxSplitSensorInfo> SplitSensors = TArray<FDTFluxSplitSensorInfo>();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user