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;
|
||||
}
|
||||
|
||||
@ -99,17 +99,17 @@ void UDTFluxContestStorage::AddSplit(const int InContest, const FDTFluxSplit& In
|
||||
|
||||
#pragma region SplitRankingRegion
|
||||
|
||||
void UDTFluxContestStorage::AddSplitRanking(const int InContest, const FDTFluxSplitRanking& InSplitRanking)
|
||||
void UDTFluxContestStorage::AddSplitRanking(const int InContest, const FDTFluxStageRanking& InSplitRanking)
|
||||
{
|
||||
}
|
||||
|
||||
void UDTFluxContestStorage::GetSplitRankingByParticipant(const FDTFluxParticipant& InParticipant, const int InContestId,
|
||||
const int InStageId, const FDTFluxSplitRanking& OutSplitRankingForBib)
|
||||
const int InStageId, const FDTFluxStageRanking& OutSplitRankingForBib)
|
||||
{
|
||||
}
|
||||
|
||||
void UDTFluxContestStorage::GetSplitRankingByBib(const int InBib, const int InContestId, const int InStageId,
|
||||
const FDTFluxSplitRanking& OutSplitRankingForBib)
|
||||
const FDTFluxStageRanking& OutSplitRankingForBib)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -20,10 +20,10 @@ void FDTFluxStageRanking::Dump() const
|
||||
|
||||
|
||||
|
||||
void FDTFluxSplitRanking::Dump() const
|
||||
{
|
||||
UE_LOG(logDTFluxCore, Log, TEXT("SplitGapItem"))
|
||||
// Participant.Dump();
|
||||
UE_LOG(logDTFluxCore, Log, TEXT("Bib %02d Rank %02d Gap %s Time %s"), Bib, Rank, *Gap, *Time);
|
||||
}
|
||||
// void FDTFluxSplitRanking::Dump() const
|
||||
// {
|
||||
// UE_LOG(logDTFluxCore, Log, TEXT("SplitGapItem"))
|
||||
// // Participant.Dump();
|
||||
// UE_LOG(logDTFluxCore, Log, TEXT("Bib %02d Rank %02d Gap %s Time %s"), Bib, Rank, *Gap, *Time);
|
||||
// }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user