Added Getter Stage/Contest/Split + Bug Fix PursuitManager Extract Passed Started Pursuit.
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "DTFluxCoreSubsystemModule.h"
|
||||
#include "Assets/DTFluxModelAsset.h"
|
||||
#include "Containers/Deque.h"
|
||||
#include "Types/Struct/FDTFluxPursuitInfo.h"
|
||||
#include "Subsystems/EngineSubsystem.h"
|
||||
@ -98,9 +100,9 @@ public:
|
||||
TArray<FDTFluxContest> GetCurrentContests();
|
||||
UFUNCTION()
|
||||
TArray<int> GetContestsIdForTime(const FDateTime Time) const;
|
||||
UFUNCTION()
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
bool GetContestForId(const int Id, FDTFluxContest& OutContest);
|
||||
UFUNCTION()
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
TArray<FDTFluxContest> GetContestsForTime(const FDateTime Time);
|
||||
|
||||
UFUNCTION()
|
||||
@ -108,6 +110,79 @@ public:
|
||||
UFUNCTION()
|
||||
TArray<FDTFluxContest> GetContests();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
void GetContest(const int ContestId, FDTFluxContest& OutContest)
|
||||
{
|
||||
OutContest = FDTFluxContest();
|
||||
if (GetContestForId(ContestId, OutContest))
|
||||
{
|
||||
return;
|
||||
}
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("ContestId %d not found in ContestDefinition"), ContestId)
|
||||
}
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
bool GetStageDefinition(const FDTFluxStageKey StageKey, FDTFluxStage& OutStageDefinition)
|
||||
{
|
||||
int ContestId = StageKey.ContestId;
|
||||
int StageId = StageKey.StageId;
|
||||
FDTFluxContest ContestDefinition;
|
||||
if (GetContestForId(ContestId, ContestDefinition))
|
||||
{
|
||||
if (ContestDefinition.Stages.IsValidIndex(StageId))
|
||||
{
|
||||
OutStageDefinition = ContestDefinition.Stages[StageId];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
OutStageDefinition = FDTFluxStage();
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("ContestId %d, StageId %d not found in ContestDefinition"),
|
||||
ContestId, StageId)
|
||||
return false;
|
||||
}
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
bool GetSplitDefinition(const FDTFluxSplitKey SplitKey, FDTFluxSplit& OutSplitDefinition)
|
||||
{
|
||||
int ContestId = SplitKey.ContestId;
|
||||
int SplitId = SplitKey.SplitId;
|
||||
FDTFluxContest ContestDefinition;
|
||||
if (GetContestForId(ContestId, ContestDefinition))
|
||||
{
|
||||
if (ContestDefinition.Splits.IsValidIndex(SplitId))
|
||||
{
|
||||
OutSplitDefinition = ContestDefinition.Splits[SplitId];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
OutSplitDefinition = FDTFluxSplit();
|
||||
UE_LOG(logDTFluxCoreSubsystem, Warning, TEXT("ContestId %d, SplitId %d not found in ContestDefinition"),
|
||||
ContestId, SplitId);
|
||||
return false;
|
||||
}
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
void GetStage(const int ContestId, const int StageId, FDTFluxStage& OutStageDefinition)
|
||||
{
|
||||
if (GetStageDefinition(FDTFluxStageKey(ContestId, StageId),
|
||||
OutStageDefinition))
|
||||
{
|
||||
return;
|
||||
}
|
||||
OutStageDefinition = FDTFluxStage();
|
||||
}
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="DTFlux|Core Subsystem")
|
||||
void GetSplit(const int ContestId, const int StageId, const int SplitId, FDTFluxSplit& OutSplitDefinition)
|
||||
{
|
||||
if (GetSplitDefinition(FDTFluxSplitKey(ContestId, StageId, SplitId),
|
||||
OutSplitDefinition))
|
||||
{
|
||||
return;
|
||||
}
|
||||
OutSplitDefinition = FDTFluxSplit();
|
||||
}
|
||||
|
||||
protected:
|
||||
// ~Subsystem Interface
|
||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
||||
|
||||
Reference in New Issue
Block a user