General Blueprint utilities Functions + First Implementation of Pursuit Logic
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
#include "DTFluxPursuitSystemModule.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FDTFluxPursuitSystemModule"
|
||||
|
||||
DEFINE_LOG_CATEGORY(logDTFluxPursuitSystem);
|
||||
|
||||
void FDTFluxPursuitSystem::StartupModule()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FDTFluxPursuitSystem::ShutdownModule()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
IMPLEMENT_MODULE(FDTFluxPursuitSystem, DTFluxPursuitSystem)
|
||||
@ -0,0 +1,81 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "Types/Objects/DTFluxPursuitManager.h"
|
||||
|
||||
#include "DTFluxCoreSubsystem.h"
|
||||
#include "DTFluxPursuitSystemModule.h"
|
||||
#include "K2Node_GetSubsystem.h"
|
||||
|
||||
|
||||
UDTFluxPursuitManager::UDTFluxPursuitManager(const FObjectInitializer& ObjectInitializer):Super(ObjectInitializer)
|
||||
{
|
||||
if(!FModuleManager::Get().IsModuleLoaded("DTFluxCoreSubsystem"))
|
||||
{
|
||||
FModuleManager::LoadModuleChecked<UDTFluxCoreSubsystem>("DTFluxCoreSubsystem");
|
||||
}
|
||||
CoreSubsystem = GEngine->GetEngineSubsystem<UDTFluxCoreSubsystem>();
|
||||
if(!CoreSubsystem)
|
||||
{
|
||||
UE_LOG(logDTFluxPursuitSystem, Error, TEXT("Cannot Get DTFluxCoreSubsystem"));
|
||||
}
|
||||
}
|
||||
|
||||
void UDTFluxPursuitManager::InitForTime(const FDateTime InFromTime)
|
||||
{
|
||||
FromTime = InFromTime;
|
||||
//Get the stage rankings
|
||||
TArray<FDTFluxContest> TargetContests = CoreSubsystem->GetContestsForTime(FromTime);
|
||||
TArray<FDTFluxPursuit> PursuitParticipantContainer;
|
||||
for(auto& Contest : TargetContests)
|
||||
{
|
||||
int LastStage = Contest.GetLastStageId();
|
||||
FDTFluxStageRankings CurrentRanking = CoreSubsystem->GetStageRankings(FDTFluxStageKey(Contest.ContestId, LastStage));
|
||||
if(CurrentRanking.IsInitialized())
|
||||
{
|
||||
TArray<FDTFluxDetailedRankingItem> Rankings = CurrentRanking.Rankings;
|
||||
for(auto& Ranking : Rankings)
|
||||
{
|
||||
Ranking.TimeStart
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
bool UDTFluxPursuitManager::GetNextPursuits(TArray<FDTFluxPursuitInfo>& OutFocusNext,
|
||||
TArray<FDTFluxPursuitInfo>& OutNext, int MaxPoursuit)
|
||||
{
|
||||
// TODO: Implement UDTFluxPursuitManager::GetNextPursuits(TArray<FDTFluxPursuitInfo>& ,TArray<FDTFluxPursuitInfo>& , int)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UDTFluxPursuitManager::GetPursuits(const FDateTime& InFromTime, TArray<FDTFluxPursuitInfo>& OutFocusNext,
|
||||
TArray<FDTFluxPursuitInfo>& OutNext, int MaxPoursuit)
|
||||
{
|
||||
// TODO: Implement UDTFluxPursuitManager::GetPursuits(const FDateTime&, TArray<FDTFluxPursuitInfo>& ,TArray<FDTFluxPursuitInfo>& , int)
|
||||
return true;
|
||||
}
|
||||
|
||||
FDateTime UDTFluxPursuitManager::GetMassStart()
|
||||
{
|
||||
//TODO : Implement me !!!
|
||||
return MassStart;
|
||||
}
|
||||
|
||||
FText UDTFluxPursuitManager::GetFormattedName(FDTFluxPursuit& InPursuit, const int MaxChar,
|
||||
const FString OverflowChar)
|
||||
{
|
||||
return InPursuit.GetFormattedName(MaxChar, OverflowChar);
|
||||
}
|
||||
|
||||
FText UDTFluxPursuitManager::DisplayPursuit(FDTFluxPursuit& InPursuit, const int MaxWidth,
|
||||
const FString NameOverflowChar)
|
||||
{
|
||||
return InPursuit.DisplayPursuit(MaxWidth, NameOverflowChar);
|
||||
}
|
||||
|
||||
bool UDTFluxPursuitManager::IsUnique(const FDTFluxPursuit& InPursuit)
|
||||
{
|
||||
return InPursuit.IsUnique();
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "Types/Struct/DTFluxPursuitStructs.h"
|
||||
|
||||
|
||||
FDTFluxPursuit::FDTFluxPursuit()
|
||||
{
|
||||
}
|
||||
|
||||
FDTFluxPursuit::~FDTFluxPursuit()
|
||||
{
|
||||
}
|
||||
|
||||
FText FDTFluxPursuit::GetFormattedName(const int MaxChar, const FString OverflowChar)
|
||||
{
|
||||
//TODO: Implement Me !!!
|
||||
return Participants[0].GetConcatFormattedName(MaxChar, OverflowChar);
|
||||
}
|
||||
|
||||
FText FDTFluxPursuit::DisplayPursuit(const int MaxWidth, const FString NameOverflowChar)
|
||||
{
|
||||
//TODO: Implement Me !!!
|
||||
return Participants[0].GetConcatFormattedName(MaxWidth, NameOverflowChar);
|
||||
}
|
||||
|
||||
bool FDTFluxPursuit::IsUnique() const
|
||||
{
|
||||
return Participants.Num() == 1;
|
||||
}
|
||||
Reference in New Issue
Block a user