Download LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemDefinition.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemDefinition.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemDefinition.cpp
-
curl -L -o LyraInventoryItemDefinition.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemDefinition.cpp
1.35 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| ////////////////////////////////////////////////////////////////////// | |
| // ULyraInventoryItemDefinition | |
| ULyraInventoryItemDefinition::ULyraInventoryItemDefinition(const FObjectInitializer& ObjectInitializer) | |
| : Super(ObjectInitializer) | |
| { | |
| } | |
| const ULyraInventoryItemFragment* ULyraInventoryItemDefinition::FindFragmentByClass(TSubclassOf<ULyraInventoryItemFragment> FragmentClass) const | |
| { | |
| if (FragmentClass != nullptr) | |
| { | |
| for (ULyraInventoryItemFragment* Fragment : Fragments) | |
| { | |
| if (Fragment && Fragment->IsA(FragmentClass)) | |
| { | |
| return Fragment; | |
| } | |
| } | |
| } | |
| return nullptr; | |
| } | |
| ////////////////////////////////////////////////////////////////////// | |
| // ULyraInventoryItemDefinition | |
| const ULyraInventoryItemFragment* ULyraInventoryFunctionLibrary::FindItemDefinitionFragment(TSubclassOf<ULyraInventoryItemDefinition> ItemDef, TSubclassOf<ULyraInventoryItemFragment> FragmentClass) | |
| { | |
| if ((ItemDef != nullptr) && (FragmentClass != nullptr)) | |
| { | |
| return GetDefault<ULyraInventoryItemDefinition>(ItemDef)->FindFragmentByClass(FragmentClass); | |
| } | |
| return nullptr; | |
| } | |