Added Blank Delegate for split Sensors + Added Getters for Contest/Stage/Split rankings for 1 participant + Global Cleaning
This commit is contained in:
@ -288,6 +288,76 @@ void UDTFluxCoreSubsystem::SendRequest(const FString& Message)
|
||||
}
|
||||
}
|
||||
|
||||
bool UDTFluxCoreSubsystem::GetStageRankingForBib(const int ContestId, const int StageId, const int Bib,
|
||||
FDTFluxStageRanking& OutStageRanking)
|
||||
{
|
||||
if (DataStorage)
|
||||
{
|
||||
FDTFluxStageKey StageKey(ContestId, StageId);
|
||||
if (DataStorage->StageRankings.Contains(StageKey))
|
||||
{
|
||||
FDTFluxStageRankings StageRankings = DataStorage->StageRankings[StageKey];
|
||||
for (auto& Ranking : StageRankings.Rankings)
|
||||
{
|
||||
if (Ranking.Bib == Bib)
|
||||
{
|
||||
OutStageRanking = static_cast<FDTFluxStageRanking>(Ranking);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Unable to find StageRanking for Bib %i"), Bib);
|
||||
return false;
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Error, TEXT("DataStorage not available"));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UDTFluxCoreSubsystem::GetSplitRankingForBib(const int ContestId, const int StageId, const int SplitId,
|
||||
const int Bib, FDTFluxSplitRanking& OutSplitRankings)
|
||||
{
|
||||
if (DataStorage)
|
||||
{
|
||||
FDTFluxSplitKey SplitKey(ContestId, StageId, SplitId);
|
||||
if (DataStorage->SplitRankings.Contains(SplitKey))
|
||||
{
|
||||
FDTFluxSplitRankings SplitRankings = DataStorage->SplitRankings[SplitKey];
|
||||
for (auto& Ranking : SplitRankings.Rankings)
|
||||
{
|
||||
if (Ranking.Bib == Bib)
|
||||
{
|
||||
OutSplitRankings = static_cast<FDTFluxSplitRanking>(Ranking);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Unable to find SplitRanking for Bib %i"), Bib);
|
||||
return false;
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Error, TEXT("DataStorage not available"));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UDTFluxCoreSubsystem::GetContestRanking(const int ContestId, FDTFluxContestRanking& OutContestRanking)
|
||||
{
|
||||
if (DataStorage)
|
||||
{
|
||||
FDTFluxContest Contest;
|
||||
if (GetContestForId(ContestId, Contest))
|
||||
{
|
||||
for (auto& Ranking : DataStorage->ContestRankings[ContestId].Rankings)
|
||||
{
|
||||
OutContestRanking = Ranking;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("Unable to find ContestRanking for ContestId %i"), ContestId);
|
||||
return false;
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Error, TEXT("DataStorage not available"));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UDTFluxCoreSubsystem::GetContestRankings(const int ContestId,
|
||||
FDTFluxContestRankings& OutContestRankings)
|
||||
{
|
||||
@ -468,13 +538,15 @@ TArray<FGuid> UDTFluxCoreSubsystem::TrackedRequestSplitRankings(const TArray<FDT
|
||||
return TArray<FGuid>();
|
||||
}
|
||||
|
||||
const FDTFluxParticipant UDTFluxCoreSubsystem::GetParticipant(int InBib)
|
||||
bool UDTFluxCoreSubsystem::GetParticipant(int InBib, FDTFluxParticipant& OutParticipant)
|
||||
{
|
||||
if (DataStorage->Participants.Contains(InBib))
|
||||
{
|
||||
return DataStorage->Participants[InBib];
|
||||
OutParticipant = DataStorage->Participants[InBib];
|
||||
return true;
|
||||
}
|
||||
return FDTFluxParticipant();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
TArray<int> UDTFluxCoreSubsystem::GetCurrentContestsId()
|
||||
|
||||
Reference in New Issue
Block a user