Query persisted generated launch requests
This commit is contained in:
parent
b22238c5a5
commit
552413e438
6 changed files with 125 additions and 0 deletions
|
|
@ -6639,6 +6639,32 @@ TArray<FHyperTwistTrainingRunRecord> UHyperTwistTrainingRepositoryLibrary::ListR
|
|||
return Records;
|
||||
}
|
||||
|
||||
bool UHyperTwistTrainingRepositoryLibrary::TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
const FHyperTwistTrainingRepositoryState& RepositoryState,
|
||||
const FString& UserId,
|
||||
const FString& DeckId,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
)
|
||||
{
|
||||
OutLaunchRequest = FHyperTwistTrainingImportedGeneratedModeLaunchRequest();
|
||||
const TArray<FHyperTwistTrainingRunRecord> Records = ListRunRecordsForDeck(RepositoryState, UserId, DeckId);
|
||||
for (const FHyperTwistTrainingRunRecord& RunRecord : Records)
|
||||
{
|
||||
if (!RunRecord.IsStructurallyValid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (RunRecord.ImportedGeneratedModeLaunchRequest.IsStructurallyValid())
|
||||
{
|
||||
OutLaunchRequest = RunRecord.ImportedGeneratedModeLaunchRequest;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
FHyperTwistTrainingCaseLearnerState UHyperTwistTrainingRepositoryLibrary::DeriveLearnerStateForCase(
|
||||
const FHyperTwistTrainingRepositoryState& RepositoryState,
|
||||
const FString& UserId,
|
||||
|
|
|
|||
|
|
@ -256,6 +256,40 @@ FHyperTwistTrainingRepositoryState UHyperTwistTrainingRuntimeLibrary::GetTrainin
|
|||
return FHyperTwistTrainingRepositoryState();
|
||||
}
|
||||
|
||||
bool UHyperTwistTrainingRuntimeLibrary::TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
UObject* WorldContextObject,
|
||||
const FString& UserId,
|
||||
const FString& DeckId,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
)
|
||||
{
|
||||
if (UHyperTwistTrainingSubsystem* TrainingSubsystem = GetTrainingSubsystem(WorldContextObject))
|
||||
{
|
||||
return TrainingSubsystem->TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
UserId,
|
||||
DeckId,
|
||||
OutLaunchRequest
|
||||
);
|
||||
}
|
||||
|
||||
OutLaunchRequest = FHyperTwistTrainingImportedGeneratedModeLaunchRequest();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UHyperTwistTrainingRuntimeLibrary::TryGetLatestGeneratedModeLaunchRequestForActiveDeck(
|
||||
UObject* WorldContextObject,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
)
|
||||
{
|
||||
if (UHyperTwistTrainingSubsystem* TrainingSubsystem = GetTrainingSubsystem(WorldContextObject))
|
||||
{
|
||||
return TrainingSubsystem->TryGetLatestGeneratedModeLaunchRequestForActiveDeck(OutLaunchRequest);
|
||||
}
|
||||
|
||||
OutLaunchRequest = FHyperTwistTrainingImportedGeneratedModeLaunchRequest();
|
||||
return false;
|
||||
}
|
||||
|
||||
FHyperTwistTrainingRepositoryIntegrityReport UHyperTwistTrainingRuntimeLibrary::GetActiveTrainingRepositoryIntegrityReport(
|
||||
UObject* WorldContextObject
|
||||
)
|
||||
|
|
|
|||
|
|
@ -942,6 +942,37 @@ FHyperTwistTrainingRepositoryState UHyperTwistTrainingSubsystem::GetTrainingRepo
|
|||
return TrainingRepositoryState;
|
||||
}
|
||||
|
||||
bool UHyperTwistTrainingSubsystem::TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
const FString& UserId,
|
||||
const FString& DeckId,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
) const
|
||||
{
|
||||
return UHyperTwistTrainingRepositoryLibrary::TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
TrainingRepositoryState,
|
||||
UserId,
|
||||
DeckId,
|
||||
OutLaunchRequest
|
||||
);
|
||||
}
|
||||
|
||||
bool UHyperTwistTrainingSubsystem::TryGetLatestGeneratedModeLaunchRequestForActiveDeck(
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
) const
|
||||
{
|
||||
if (!HasActiveRun())
|
||||
{
|
||||
OutLaunchRequest = FHyperTwistTrainingImportedGeneratedModeLaunchRequest();
|
||||
return false;
|
||||
}
|
||||
|
||||
return TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
ActiveRunState.Session.UserId,
|
||||
ActiveRunState.Session.DeckId,
|
||||
OutLaunchRequest
|
||||
);
|
||||
}
|
||||
|
||||
FHyperTwistTrainingRepositoryIntegrityReport UHyperTwistTrainingSubsystem::GetActiveRepositoryIntegrityReport() const
|
||||
{
|
||||
return ActiveRepositoryIntegrityReport;
|
||||
|
|
|
|||
|
|
@ -156,6 +156,14 @@ public:
|
|||
const FString& DeckId
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training|Repository")
|
||||
static bool TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
const FHyperTwistTrainingRepositoryState& RepositoryState,
|
||||
const FString& UserId,
|
||||
const FString& DeckId,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training|Repository")
|
||||
static FHyperTwistTrainingCaseLearnerState DeriveLearnerStateForCase(
|
||||
const FHyperTwistTrainingRepositoryState& RepositoryState,
|
||||
|
|
|
|||
|
|
@ -109,6 +109,20 @@ public:
|
|||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training", meta = (WorldContext = "WorldContextObject"))
|
||||
static FHyperTwistTrainingRepositoryState GetTrainingRepositoryState(UObject* WorldContextObject);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training", meta = (WorldContext = "WorldContextObject"))
|
||||
static bool TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
UObject* WorldContextObject,
|
||||
const FString& UserId,
|
||||
const FString& DeckId,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training", meta = (WorldContext = "WorldContextObject"))
|
||||
static bool TryGetLatestGeneratedModeLaunchRequestForActiveDeck(
|
||||
UObject* WorldContextObject,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training", meta = (WorldContext = "WorldContextObject"))
|
||||
static FHyperTwistTrainingRepositoryIntegrityReport GetActiveTrainingRepositoryIntegrityReport(
|
||||
UObject* WorldContextObject
|
||||
|
|
|
|||
|
|
@ -89,6 +89,18 @@ public:
|
|||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training")
|
||||
FHyperTwistTrainingRepositoryState GetTrainingRepositoryState() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training")
|
||||
bool TryGetLatestGeneratedModeLaunchRequestForDeck(
|
||||
const FString& UserId,
|
||||
const FString& DeckId,
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
) const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Training")
|
||||
bool TryGetLatestGeneratedModeLaunchRequestForActiveDeck(
|
||||
FHyperTwistTrainingImportedGeneratedModeLaunchRequest& OutLaunchRequest
|
||||
) const;
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training")
|
||||
FHyperTwistTrainingRepositoryIntegrityReport GetActiveRepositoryIntegrityReport() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue