Added Events OnDisplayRankings to launch Display of rankings in BluePrints.
This commit is contained in:
@ -13,6 +13,11 @@ UDTFluxModelAsset::UDTFluxModelAsset(const FObjectInitializer& ObjectInitializer
|
||||
void UDTFluxModelAsset::AddContest(const FDTFluxContest& Contest)
|
||||
{
|
||||
Contests.Add(Contest.Name, Contest);
|
||||
// initialisation
|
||||
for (const auto& Stage : Contest.Stages)
|
||||
{
|
||||
FinishedStagesCache.Add(FDTFluxStageKey(Contest.ContestId, Stage.StageId), Stage.IsFinished());
|
||||
}
|
||||
}
|
||||
|
||||
bool UDTFluxModelAsset::GetContestById(const int InContestId, FDTFluxContest& OutContest)
|
||||
@ -132,6 +137,32 @@ bool UDTFluxModelAsset::GetParticipantByBib(int Bib, FDTFluxParticipant& OutPart
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UDTFluxModelAsset::IsStageFinished(FDTFluxStageKey StageKey)
|
||||
{
|
||||
if (!FinishedStagesCache.Contains(StageKey))
|
||||
{
|
||||
if (FinishedStagesCache[StageKey])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//maybe stage is finished because we have not be able to set it ?
|
||||
return CheckStageIsFinished(StageKey);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool UDTFluxModelAsset::CheckStageIsFinished(FDTFluxStageKey StageKey)
|
||||
{
|
||||
FDTFluxStage Stage;
|
||||
if (GetStage(StageKey, Stage))
|
||||
{
|
||||
FinishedStagesCache.Add(StageKey, Stage.IsFinished());
|
||||
return FinishedStagesCache[StageKey];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void UDTFluxModelAsset::UpdateOrCreateStageRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user