Files
UnrealEngineUWP/Engine/Source/Runtime/UniversalObjectLocator/Private/UniversalObjectLocatorRegistry.cpp
andrew rodham 71231a95e7 Added the ability to provide arbitrary parameters to UOL resolution functions
Parameters must be registered with the UOL module in much the same way as fragment types.
Tidied up globals into a singleton Registry class.
Added a function to FUniversalObjectLocator that allows manual addition of fragments.

Also removed the defunct IActorLocatorFragmentResolver interface in favor of supplying these parameters externally.
Corrected Anim Instance locators being always used when trying to address skeletal mesh components.

#rb david.bromberg

[CL 29890178 by andrew rodham in ue5-main branch]
2023-11-22 12:02:21 -05:00

38 lines
857 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "UniversalObjectLocatorRegistry.h"
#include "UniversalObjectLocatorFwd.h"
#include "UniversalObjectLocatorFragmentType.h"
#include "Algo/Find.h"
namespace UE::UniversalObjectLocator
{
FRegistry& FRegistry::Get()
{
static FRegistry Registry;
return Registry;
}
const FFragmentType* FRegistry::FindFragmentType(FName ID) const
{
return Algo::FindBy(FragmentTypes, ID, &FFragmentType::FragmentTypeID);
}
void FRegistry::AddReferencedObjects(FReferenceCollector& Collector)
{
Collector.AddReferencedObjects(ParameterTypes);
for (FFragmentType& FragmentType : FragmentTypes)
{
Collector.AddReferencedObject(FragmentType.PayloadType);
}
}
FString FRegistry::GetReferencerName() const
{
return TEXT("UE::UniversalObjectLocator::FRegistry");
}
} // namespace UE::UniversalObjectLocator