Ranking reforge. SplitRanking is not implemented yet !!!
This commit is contained in:
@ -6,37 +6,6 @@
|
||||
#include "Types/Objects/DTFluxContestStorage.h"
|
||||
|
||||
|
||||
// const FDateTime UDTFluxModelAsset::GetMassStart(const int& ContestId, const int& StageId)
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
// void UDTFluxModelAsset::InsertOrUpdateRaceData(const TSharedPtr<FJsonObject>& Response)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// void UDTFluxModelAsset::InsertOrUpdateContestRanking(const TSharedPtr<FJsonObject>& Response)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// void UDTFluxModelAsset::InsertOrUpdateStageRanking(const TSharedPtr<FJsonObject>& Response)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// void UDTFluxModelAsset::InsertOrUpdateSplitRanking(const TSharedPtr<FJsonObject>& Response)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// void UDTFluxModelAsset::InsertOrUpdateTeamList(const TSharedPtr<FJsonObject>& Response)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// void UDTFluxModelAsset::SplitSensorTriggered(const TSharedPtr<FJsonObject>& Response)
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
UDTFluxModelAsset::UDTFluxModelAsset(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
@ -93,3 +62,47 @@ bool UDTFluxModelAsset::PersonExists(const FDTFluxPerson& InPerson) const
|
||||
return Person == InPerson;
|
||||
});
|
||||
}
|
||||
|
||||
FString UDTFluxModelAsset::GetContestNameForId(const int InContestID)
|
||||
{
|
||||
FDTFluxContest Contest;
|
||||
if(!GetContestById(InContestID, Contest))
|
||||
{
|
||||
UE_LOG(logDTFluxCore, Warning, TEXT("GetContestNameForId(%i) [unable to find a contest] result will be empty !!!"),
|
||||
InContestID);
|
||||
}
|
||||
return Contest.Name;
|
||||
}
|
||||
|
||||
void UDTFluxModelAsset::AddContestRanking(const FDTFluxContestRankings& NewContestRankings)
|
||||
{
|
||||
ContestRankings.Add(NewContestRankings.ContestId, NewContestRankings);
|
||||
}
|
||||
|
||||
bool UDTFluxModelAsset::UpdateStageRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
{
|
||||
const int ContestId = InStageRankings.ContestId;
|
||||
const int StageId = InStageRankings.StageId;
|
||||
int Index = 0;
|
||||
int StageRankingArraySize = StageRankings.Num()-1;
|
||||
for(auto Ranking : StageRankings)
|
||||
{
|
||||
if(Ranking.ContestId == ContestId && Ranking.StageId == StageId)
|
||||
{
|
||||
Index++;
|
||||
break;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
if(Index != StageRankingArraySize )
|
||||
{
|
||||
StageRankings[Index] = InStageRankings;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UDTFluxModelAsset::UpdateSplitRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user