General Blueprint utilities Functions + First Implementation of Pursuit Logic

This commit is contained in:
2025-07-04 15:17:22 +02:00
parent 801e946a89
commit a2be97cfe4
20 changed files with 503 additions and 109 deletions

View File

@ -207,6 +207,16 @@ void UDTFluxCoreSubsystem::RequestAllSplitRankingOfContest(int InContestId, int
// TODO Implement this
}
FDTFluxStageRankings UDTFluxCoreSubsystem::GetStageRankings(FDTFluxStageKey StageKey)
{
if(DataStorage->StageRankings.Contains(StageKey))
{
return DataStorage->StageRankings[StageKey];
}
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Cannot find StageRankings for key [%s]"), *StageKey.GetDisplayName());
return FDTFluxStageRankings();
}
void UDTFluxCoreSubsystem::RequestAllSplitRankingOfStage(int InContestId, int InStageId, int InSplitId)
{
// TODO Implement this
@ -216,3 +226,42 @@ void UDTFluxCoreSubsystem::RefreshStorage()
{
// TODO Implement this
}
TArray<int> UDTFluxCoreSubsystem::GetCurrentContestsId()
{
return GetContestsIdForTime(FDateTime::Now());
}
TArray<FDTFluxContest> UDTFluxCoreSubsystem::GetCurrentContests()
{
return GetContestsForTime(FDateTime::Now());
}
TArray<int> UDTFluxCoreSubsystem::GetContestsIdForTime(const FDateTime Time)
{
TArray<int> Contests;
for(const auto& Pair : DataStorage->Contests)
{
FDTFluxContest Contest = Pair.Value;
int ContestId = Contest.ContestId;
if(Contest.Date < Time && Contest.EndTime > Time)
{
Contests.Add(ContestId);
}
}
return Contests;
}
TArray<FDTFluxContest> UDTFluxCoreSubsystem::GetContestsForTime(const FDateTime Time)
{
TArray<FDTFluxContest> Contests;
for(const auto& Pair : DataStorage->Contests)
{
FDTFluxContest Contest = Pair.Value;
int ContestId = Contest.ContestId;
if(Contest.Date < Time && Contest.EndTime > Time)
{
Contests.Add(Contest);
}
}
return Contests;
}