// Copyright Epic Games, Inc. All Rights Reserved. #include "LyraInventoryItemDefinition.h" ////////////////////////////////////////////////////////////////////// // ULyraInventoryItemDefinition ULyraInventoryItemDefinition::ULyraInventoryItemDefinition(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { } const ULyraInventoryItemFragment* ULyraInventoryItemDefinition::FindFragmentByClass(TSubclassOf FragmentClass) const { if (FragmentClass != nullptr) { for (ULyraInventoryItemFragment* Fragment : Fragments) { if (Fragment && Fragment->IsA(FragmentClass)) { return Fragment; } } } return nullptr; } ////////////////////////////////////////////////////////////////////// // ULyraInventoryItemDefinition const ULyraInventoryItemFragment* ULyraInventoryFunctionLibrary::FindItemDefinitionFragment(TSubclassOf ItemDef, TSubclassOf FragmentClass) { if ((ItemDef != nullptr) && (FragmentClass != nullptr)) { return GetDefault(ItemDef)->FindFragmentByClass(FragmentClass); } return nullptr; }