Cosmetic CoreSubsystem cleaning + Added DTFluxDetailedRanking Casting functions
This commit is contained in:
@ -617,3 +617,78 @@ TArray<FDTFluxContest> UDTFluxCoreSubsystem::GetContests()
|
||||
}
|
||||
return TArray<FDTFluxContest>();
|
||||
}
|
||||
|
||||
void UDTFluxCoreSubsystem::GetContest(const int ContestId, FDTFluxContest& OutContest)
|
||||
{
|
||||
OutContest = FDTFluxContest();
|
||||
if (GetContestForId(ContestId, OutContest))
|
||||
{
|
||||
return;
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("ContestId %d not found in ContestDefinition"), ContestId)
|
||||
}
|
||||
|
||||
bool UDTFluxCoreSubsystem::GetStageDefinition(const FDTFluxStageKey StageKey, FDTFluxStage& OutStageDefinition)
|
||||
{
|
||||
int ContestId = StageKey.ContestId;
|
||||
int StageId = StageKey.StageId;
|
||||
FDTFluxContest ContestDefinition;
|
||||
if (GetContestForId(ContestId, ContestDefinition))
|
||||
{
|
||||
for (auto& Stage : ContestDefinition.Stages)
|
||||
{
|
||||
if (Stage.StageId == StageId)
|
||||
{
|
||||
OutStageDefinition = Stage;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
OutStageDefinition = FDTFluxStage();
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("ContestId %d, StageId %d not found in ContestDefinition"),
|
||||
ContestId, StageId)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UDTFluxCoreSubsystem::GetSplitDefinition(const FDTFluxSplitKey SplitKey, FDTFluxSplit& OutSplitDefinition)
|
||||
{
|
||||
int ContestId = SplitKey.ContestId;
|
||||
int SplitId = SplitKey.SplitId;
|
||||
FDTFluxContest ContestDefinition;
|
||||
if (GetContestForId(ContestId, ContestDefinition))
|
||||
{
|
||||
for (auto& Split : ContestDefinition.Splits)
|
||||
{
|
||||
if (Split.SplitId == SplitId)
|
||||
{
|
||||
OutSplitDefinition = Split;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
OutSplitDefinition = FDTFluxSplit();
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("ContestId %d, SplitId %d not found in ContestDefinition"),
|
||||
ContestId, SplitId);
|
||||
return false;
|
||||
}
|
||||
|
||||
void UDTFluxCoreSubsystem::GetStage(const int ContestId, const int StageId, FDTFluxStage& OutStageDefinition)
|
||||
{
|
||||
if (GetStageDefinition(FDTFluxStageKey(ContestId, StageId),
|
||||
OutStageDefinition))
|
||||
{
|
||||
return;
|
||||
}
|
||||
OutStageDefinition = FDTFluxStage();
|
||||
}
|
||||
|
||||
void UDTFluxCoreSubsystem::GetSplit(const int ContestId, const int StageId, const int SplitId,
|
||||
FDTFluxSplit& OutSplitDefinition)
|
||||
{
|
||||
if (GetSplitDefinition(FDTFluxSplitKey(ContestId, StageId, SplitId),
|
||||
OutSplitDefinition))
|
||||
{
|
||||
return;
|
||||
}
|
||||
OutSplitDefinition = FDTFluxSplit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user