ModelAsset Fixed And Server Response Implementation + Notes.md for sharing problematics
This commit is contained in:
@ -81,6 +81,35 @@ void UDTFluxModelAsset::AddContestRanking(const FDTFluxContestRankings& NewConte
|
||||
ContestRankings.Add(NewContestRankings.ContestId, NewContestRankings);
|
||||
}
|
||||
|
||||
void UDTFluxModelAsset::UpdateParticipant(const FDTFluxParticipant& Participant)
|
||||
{
|
||||
// TODO : If update is on Bib we are totally lost as we search by bib.
|
||||
int Bib = Participant.Bib;
|
||||
if(Participants.Contains(Bib))
|
||||
{
|
||||
TArray<FDTFluxPerson> InTeammate = Participant.Teammate;
|
||||
Participants[Bib].Elite = Participant.Elite;
|
||||
Participants[Bib].ContestId = Participant.ContestId;
|
||||
Participants[Bib].Club = Participant.Club;
|
||||
Participants[Bib].Category = Participant.Category;
|
||||
Participants[Bib].Team = Participant.Team;
|
||||
Participants[Bib].Status = Participant.Status;
|
||||
//TODO : Update Person
|
||||
for(const auto& Person : InTeammate)
|
||||
{
|
||||
//Don't know what to do...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UDTFluxModelAsset::UpdateParticipantStatus(const FDTFluxTeamStatusUpdate& NewParticipantStatus)
|
||||
{
|
||||
if(Participants.Contains(NewParticipantStatus.Bib))
|
||||
{
|
||||
Participants[NewParticipantStatus.Bib].Status = NewParticipantStatus.Status;
|
||||
}
|
||||
}
|
||||
|
||||
void UDTFluxModelAsset::UpdateOrCreateStageRanking(const FDTFluxStageRankings& InStageRankings)
|
||||
{
|
||||
FDTFluxStageKey StageKey = InStageRankings.GetCompositeKey();
|
||||
|
||||
@ -103,7 +103,7 @@ FDTFluxParticipant::FDTFluxParticipant(const TSharedPtr<FJsonObject>& JsonObject
|
||||
, Status(static_cast<EDTFluxParticipantStatusType>(JsonObject->GetIntegerField(TEXT("status"))))
|
||||
, Team(JsonObject->GetStringField(TEXT("team")))
|
||||
, bIsMassStartParticipant(false)
|
||||
, LastSplitId(-1)
|
||||
, CurrentSplit(-1)
|
||||
{
|
||||
UE_LOG(logDTFluxCore, Error, TEXT("Ctor with JSON Object"))
|
||||
for(uint8 Index = 1; ; Index++)
|
||||
|
||||
@ -75,4 +75,10 @@ public:
|
||||
|
||||
UFUNCTION()
|
||||
void AddContestRanking(const FDTFluxContestRankings& NewContestRankings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Participant")
|
||||
void UpdateParticipant(const FDTFluxParticipant& Participant);
|
||||
|
||||
UFUNCTION(BlueprintCallable, CallInEditor, Category="DTFlux|Participant")
|
||||
void UpdateParticipantStatus(const FDTFluxTeamStatusUpdate& NewParticipantStatus);
|
||||
};
|
||||
|
||||
@ -99,7 +99,7 @@ public:
|
||||
, Elite(false)
|
||||
, Status(static_cast<EDTFluxParticipantStatusType>(0))
|
||||
, bIsMassStartParticipant(false)
|
||||
, LastSplitId(0)
|
||||
, CurrentSplit(-1)
|
||||
{
|
||||
Teammate.Reset();
|
||||
}
|
||||
@ -130,7 +130,7 @@ public:
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model", EditAnywhere)
|
||||
bool bIsMassStartParticipant = false;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|model")
|
||||
int LastSplitId = -1;
|
||||
int CurrentSplit = -1;
|
||||
|
||||
// void Dump() const;
|
||||
void AddTeammate(const FDTFluxPerson& Person);
|
||||
|
||||
Reference in New Issue
Block a user