You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
68 lines
1.7 KiB
C
68 lines
1.7 KiB
C
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "CollectionManagerTypes.h"
|
|
#include "ICollectionManager.h"
|
|
#include "CollectionManagerModule.h"
|
|
|
|
struct FSourcesData
|
|
{
|
|
TArray<FName> VirtualPaths;
|
|
TArray<FCollectionNameType> Collections;
|
|
|
|
FSourcesData() = default;
|
|
|
|
explicit FSourcesData(FName InVirtualPath)
|
|
{
|
|
VirtualPaths.Add(InVirtualPath);
|
|
}
|
|
|
|
explicit FSourcesData(FCollectionNameType InCollection)
|
|
{
|
|
Collections.Add(InCollection);
|
|
}
|
|
|
|
FSourcesData(TArray<FName> InVirtualPaths, TArray<FCollectionNameType> InCollections)
|
|
: VirtualPaths(MoveTemp(InVirtualPaths))
|
|
, Collections(MoveTemp(InCollections))
|
|
{
|
|
}
|
|
|
|
FSourcesData(const FSourcesData& Other) = default;
|
|
FSourcesData(FSourcesData&& Other) = default;
|
|
|
|
FSourcesData& operator=(const FSourcesData& Other) = default;
|
|
FSourcesData& operator=(FSourcesData&& Other) = default;
|
|
|
|
FORCEINLINE bool IsEmpty() const
|
|
{
|
|
return VirtualPaths.Num() == 0 && Collections.Num() == 0;
|
|
}
|
|
|
|
FORCEINLINE bool HasVirtualPaths() const
|
|
{
|
|
return VirtualPaths.Num() > 0;
|
|
}
|
|
|
|
FORCEINLINE bool HasCollections() const
|
|
{
|
|
return Collections.Num() > 0;
|
|
}
|
|
|
|
bool IsDynamicCollection() const
|
|
{
|
|
if ( Collections.Num() == 1 && FCollectionManagerModule::IsModuleAvailable() )
|
|
{
|
|
// Collection manager module should already be loaded since it may cause a hitch on the first search
|
|
FCollectionManagerModule& CollectionManagerModule = FCollectionManagerModule::GetModule();
|
|
|
|
ECollectionStorageMode::Type StorageMode = ECollectionStorageMode::Static;
|
|
return (CollectionManagerModule.Get().GetCollectionStorageMode(Collections[0].Name, Collections[0].Type, StorageMode) && StorageMode == ECollectionStorageMode::Dynamic);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
};
|