Report imported generated selector choices in summaries
This commit is contained in:
parent
0ba5cd033a
commit
2b899aedc5
5 changed files with 35 additions and 6 deletions
|
|
@ -1507,7 +1507,8 @@ FHyperTwistTrainingCaseSelection UHyperTwistTrainingLibrary::SelectNextTrainingC
|
|||
|
||||
FHyperTwistTrainingSessionSummary UHyperTwistTrainingLibrary::DeriveTrainingSessionSummary(
|
||||
const FHyperTwistTrainingSession& Session,
|
||||
const TArray<FHyperTwistTrainingAttempt>& Attempts
|
||||
const TArray<FHyperTwistTrainingAttempt>& Attempts,
|
||||
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState
|
||||
)
|
||||
{
|
||||
FHyperTwistTrainingSessionSummary Summary;
|
||||
|
|
@ -1587,6 +1588,13 @@ FHyperTwistTrainingSessionSummary UHyperTwistTrainingLibrary::DeriveTrainingSess
|
|||
Summary.SuccessRate = static_cast<float>(Summary.SuccessCount) / static_cast<float>(Summary.CompletedAttemptCount);
|
||||
}
|
||||
|
||||
if (ImportedRuntimeSelectionState.IsStructurallyValid())
|
||||
{
|
||||
Summary.ImportedRuntimeSurfaceId = ImportedRuntimeSelectionState.SurfaceId;
|
||||
Summary.ImportedRuntimeSurfaceKind = ImportedRuntimeSelectionState.SurfaceKind;
|
||||
Summary.ImportedRuntimeSelectorChoices = ImportedRuntimeSelectionState.SelectorChoices;
|
||||
}
|
||||
|
||||
return Summary;
|
||||
}
|
||||
|
||||
|
|
@ -1907,7 +1915,8 @@ FHyperTwistTrainingRunStepResult UHyperTwistTrainingLibrary::ResolveTrainingRunA
|
|||
|
||||
StepResult.SessionSummary = DeriveTrainingSessionSummary(
|
||||
StepResult.UpdatedRunState.Session,
|
||||
StepResult.UpdatedRunState.Attempts
|
||||
StepResult.UpdatedRunState.Attempts,
|
||||
StepResult.UpdatedRunState.ImportedRuntimeSelectionState
|
||||
);
|
||||
return StepResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5726,7 +5726,11 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
|
|||
}
|
||||
|
||||
RunRecord.Session = Session;
|
||||
RunRecord.Summary = UHyperTwistTrainingLibrary::DeriveTrainingSessionSummary(Session, Attempts);
|
||||
RunRecord.Summary = UHyperTwistTrainingLibrary::DeriveTrainingSessionSummary(
|
||||
Session,
|
||||
Attempts,
|
||||
FHyperTwistTrainingImportedRuntimeSelectionState()
|
||||
);
|
||||
RunRecord.Attempts = Attempts;
|
||||
RunRecord.LastUpdatedAtUtc = Session.EndedAtUtc;
|
||||
RunRecord.bCompleted = true;
|
||||
|
|
@ -5941,8 +5945,10 @@ FHyperTwistTrainingRunRecord UHyperTwistTrainingRepositoryLibrary::BuildRunRecor
|
|||
RunRecord.Session = RunState.Session;
|
||||
RunRecord.Summary = UHyperTwistTrainingLibrary::DeriveTrainingSessionSummary(
|
||||
RunState.Session,
|
||||
RunState.Attempts
|
||||
RunState.Attempts,
|
||||
RunState.ImportedRuntimeSelectionState
|
||||
);
|
||||
RunRecord.ImportedRuntimeSelectionState = RunState.ImportedRuntimeSelectionState;
|
||||
RunRecord.Attempts = RunState.Attempts;
|
||||
RunRecord.RemainingCaseIds = RunState.RemainingCaseIds;
|
||||
RunRecord.ReplayId = RunState.ReplayPacket.ReplayId;
|
||||
|
|
|
|||
|
|
@ -3120,7 +3120,8 @@ void UHyperTwistTrainingSubsystem::RefreshSummary()
|
|||
|
||||
ActiveRunSummary = UHyperTwistTrainingLibrary::DeriveTrainingSessionSummary(
|
||||
ActiveRunState.Session,
|
||||
ActiveRunState.Attempts
|
||||
ActiveRunState.Attempts,
|
||||
ActiveRunState.ImportedRuntimeSelectionState
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ public:
|
|||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training")
|
||||
static FHyperTwistTrainingSessionSummary DeriveTrainingSessionSummary(
|
||||
const FHyperTwistTrainingSession& Session,
|
||||
const TArray<FHyperTwistTrainingAttempt>& Attempts
|
||||
const TArray<FHyperTwistTrainingAttempt>& Attempts,
|
||||
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training")
|
||||
|
|
|
|||
|
|
@ -774,6 +774,15 @@ struct FHyperTwistTrainingSessionSummary
|
|||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString LastCompletedAtUtc;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString ImportedRuntimeSurfaceId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString ImportedRuntimeSurfaceKind;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistTrainingImportedRuntimeSelectorChoice> ImportedRuntimeSelectorChoices;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
|
|
@ -1225,6 +1234,9 @@ struct FHyperTwistTrainingRunRecord
|
|||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bCompleted = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FHyperTwistTrainingImportedRuntimeSelectionState ImportedRuntimeSelectionState;
|
||||
|
||||
bool IsStructurallyValid() const
|
||||
{
|
||||
return Session.IsStructurallyValid() && Summary.TrainingSessionId == Session.TrainingSessionId;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue