Added Poursuit Handle
This commit is contained in:
@ -537,6 +537,71 @@ const FString UDTFluxDataStorage::GetConcurrentFormatedName(int Bib, bool Trunca
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable once IdentifierTypo
|
||||||
|
TArray<FDTFluxStageRanking> UDTFluxDataStorage::GetPoursuitWithStageTime(const TArray<int> ContestIds, const int StageId, float DelaTimeSeconds)
|
||||||
|
{
|
||||||
|
TArray<int> RemoveIdx;
|
||||||
|
int Idx = 0;
|
||||||
|
TArray<FDTFluxStageRanking> StagesRankingsTemp;
|
||||||
|
TArray<FDTFluxStageRanking> ReturnStageRankings;
|
||||||
|
FDateTime PresumedStartStage;
|
||||||
|
for(const int ContestId : ContestIds)
|
||||||
|
{
|
||||||
|
FDTFluxStage StageTemp;
|
||||||
|
if(GetStage(ContestId, StageId, StageTemp))
|
||||||
|
{
|
||||||
|
PresumedStartStage = StageTemp.StartTime;
|
||||||
|
StagesRankingsTemp .Append(StageTemp.StageRanking);
|
||||||
|
// ContestsRankings
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StagesRankingsTemp.Sort([](const FDTFluxStageRanking& A, const FDTFluxStageRanking& B)
|
||||||
|
{
|
||||||
|
return A.TimeStart > B.TimeStart;
|
||||||
|
});
|
||||||
|
FDateTime MassStartDate = PresumedStartStage + FTimespan::FromSeconds(DelaTimeSeconds) ;
|
||||||
|
for( auto & StageRanking : StagesRankingsTemp)
|
||||||
|
{
|
||||||
|
if ( StageRanking.TimeStart < MassStartDate )
|
||||||
|
{
|
||||||
|
ReturnStageRankings.Add(StageRanking);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ReturnStageRankings;
|
||||||
|
|
||||||
|
}
|
||||||
|
// ReSharper disable once IdentifierTypo
|
||||||
|
TArray<FDTFluxStageRanking> UDTFluxDataStorage::GetPoursuitWithTimeStart(const TArray<int> ContestIds, const int StageId, float DelaTimeSeconds)
|
||||||
|
{
|
||||||
|
TArray<int> RemoveIdx;
|
||||||
|
int Idx = 0;
|
||||||
|
TArray<FDTFluxStageRanking> StagesRankingsTemp;
|
||||||
|
TArray<FDTFluxStageRanking> ReturnStageRankings;
|
||||||
|
for(const int ContestId : ContestIds)
|
||||||
|
{
|
||||||
|
FDTFluxStage StageTemp;
|
||||||
|
if(GetStage(ContestId, StageId, StageTemp))
|
||||||
|
{
|
||||||
|
StagesRankingsTemp .Append(StageTemp.StageRanking);
|
||||||
|
// ContestsRankings
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StagesRankingsTemp.Sort([](const FDTFluxStageRanking& A, const FDTFluxStageRanking& B)
|
||||||
|
{
|
||||||
|
return A.TimeStart > B.TimeStart;
|
||||||
|
});
|
||||||
|
FDateTime MassStartDate = StagesRankingsTemp[0].TimeStart + FTimespan::FromSeconds(DelaTimeSeconds) ;
|
||||||
|
for( auto & StageRanking : StagesRankingsTemp)
|
||||||
|
{
|
||||||
|
if ( StageRanking.TimeStart < MassStartDate )
|
||||||
|
{
|
||||||
|
ReturnStageRankings.Add(StageRanking);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ReturnStageRankings;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool UDTFluxDataStorage::GetFirstStageOfContest(const int ContestId, FDTFluxStage& Stage)
|
bool UDTFluxDataStorage::GetFirstStageOfContest(const int ContestId, FDTFluxStage& Stage)
|
||||||
{
|
{
|
||||||
if(Contests.IsEmpty())
|
if(Contests.IsEmpty())
|
||||||
|
|||||||
@ -112,6 +112,13 @@ public:
|
|||||||
void ChangeCurrentContest();
|
void ChangeCurrentContest();
|
||||||
UFUNCTION(BlueprintCallable, Category="DTFlux|DataStorage")
|
UFUNCTION(BlueprintCallable, Category="DTFlux|DataStorage")
|
||||||
const FString GetConcurrentFormatedName( int Bib, bool Truncate = true, int MaxSize = 20);
|
const FString GetConcurrentFormatedName( int Bib, bool Truncate = true, int MaxSize = 20);
|
||||||
|
UFUNCTION(BlueprintCallable, Category="DTFlux|DataStorage")
|
||||||
|
// ReSharper disable once IdentifierTypo
|
||||||
|
TArray<FDTFluxStageRanking> GetPoursuitWithStageTime(const TArray<int> ContestIds, const int StageId, float DelaTimeSeconds = 300.0f);
|
||||||
|
UFUNCTION(BlueprintCallable, Category="DTFlux|DataStorage")
|
||||||
|
// ReSharper disable once IdentifierTypo
|
||||||
|
TArray<FDTFluxStageRanking> GetPoursuitWithTimeStart(const TArray<int> ContestIds, const int StageId, float DelaTimeSeconds);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
bool GetFirstStageOfContest(const int ContestId, FDTFluxStage& Stage);
|
bool GetFirstStageOfContest(const int ContestId, FDTFluxStage& Stage);
|
||||||
void DumpContest();
|
void DumpContest();
|
||||||
|
|||||||
@ -567,3 +567,14 @@ struct DTFLUXAPI_API FDTFluxContestFinished
|
|||||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
||||||
TArray<FDTFluxStageRanking> Rankings;
|
TArray<FDTFluxStageRanking> Rankings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
USTRUCT(BlueprintType, Category="DTFlux|Subsystem")
|
||||||
|
struct FDTFluxPoursuit
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem")
|
||||||
|
int Bib;
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem")
|
||||||
|
FDateTime TimeStart;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user