You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UETOOL-3823 #rb brooke.hubert #preflight 6109d1e9b4288d0001acb7ef #ROBOMERGE-SOURCE: CL 17055606 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v850-17047176) [CL 17055619 by michael balzer in ue5-release-engine-test branch]
45 lines
894 B
C++
45 lines
894 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ContextObjectStore.h"
|
|
|
|
UObject* UContextObjectStore::FindContextByClass(UClass* InClass) const
|
|
{
|
|
for (UObject* ContextObject : ContextObjects)
|
|
{
|
|
if (ContextObject && ContextObject->IsA(InClass))
|
|
{
|
|
return ContextObject;
|
|
}
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
bool UContextObjectStore::AddContextObject(UObject* InContextObject)
|
|
{
|
|
if (InContextObject)
|
|
{
|
|
return ContextObjects.AddUnique(InContextObject) != INDEX_NONE;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool UContextObjectStore::RemoveContextObject(UObject* InContextObject)
|
|
{
|
|
return ContextObjects.RemoveSingle(InContextObject) != 0;
|
|
}
|
|
|
|
bool UContextObjectStore::RemoveContextObjectsOfType(const UClass* InClass)
|
|
{
|
|
return (ContextObjects.RemoveAll([InClass](UObject* InObject)
|
|
{
|
|
return InObject->IsA(InClass);
|
|
}) > 0);
|
|
}
|
|
|
|
void UContextObjectStore::Shutdown()
|
|
{
|
|
ContextObjects.Empty();
|
|
}
|