You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
41 lines
909 B
C++
41 lines
909 B
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AnimationDataSource.h"
|
|
|
|
bool UAnimationDataSourceRegistry::RegisterDataSource(const FName& InName, UObject* InDataSource)
|
|
{
|
|
if (DataSources.Contains(InName))
|
|
{
|
|
return false;
|
|
}
|
|
DataSources.Add(InName, InDataSource);
|
|
return true;
|
|
}
|
|
|
|
bool UAnimationDataSourceRegistry::UnregisterDataSource(const FName& InName)
|
|
{
|
|
return DataSources.Remove(InName) > 0;
|
|
}
|
|
|
|
bool UAnimationDataSourceRegistry::ContainsSource(const FName& InName) const
|
|
{
|
|
return DataSources.Contains(InName);
|
|
}
|
|
|
|
UObject* UAnimationDataSourceRegistry::RequestSource(const FName& InName, UClass* InExpectedClass) const
|
|
{
|
|
UObject* const* DataSource = DataSources.Find(InName);
|
|
if (DataSource == nullptr)
|
|
{
|
|
return nullptr;
|
|
}
|
|
if (*DataSource == nullptr)
|
|
{
|
|
return nullptr;
|
|
}
|
|
if (!(*DataSource)->IsA(InExpectedClass))
|
|
{
|
|
return nullptr;
|
|
}
|
|
return *DataSource;
|
|
} |