Download LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.17 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.cpp
-
curl -L -o LyraInventoryItemInstance.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.cpp
2.17 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class FLifetimeProperty; | |
| ULyraInventoryItemInstance::ULyraInventoryItemInstance(const FObjectInitializer& ObjectInitializer) | |
| : Super(ObjectInitializer) | |
| { | |
| } | |
| void ULyraInventoryItemInstance::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const | |
| { | |
| Super::GetLifetimeReplicatedProps(OutLifetimeProps); | |
| DOREPLIFETIME(ThisClass, StatTags); | |
| DOREPLIFETIME(ThisClass, ItemDef); | |
| } | |
| void ULyraInventoryItemInstance::RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags) | |
| { | |
| using namespace UE::Net; | |
| // Build descriptors and allocate PropertyReplicationFragments for this object | |
| FReplicationFragmentUtil::CreateAndRegisterFragmentsForObject(this, Context, RegistrationFlags); | |
| } | |
| void ULyraInventoryItemInstance::AddStatTagStack(FGameplayTag Tag, int32 StackCount) | |
| { | |
| StatTags.AddStack(Tag, StackCount); | |
| } | |
| void ULyraInventoryItemInstance::RemoveStatTagStack(FGameplayTag Tag, int32 StackCount) | |
| { | |
| StatTags.RemoveStack(Tag, StackCount); | |
| } | |
| int32 ULyraInventoryItemInstance::GetStatTagStackCount(FGameplayTag Tag) const | |
| { | |
| return StatTags.GetStackCount(Tag); | |
| } | |
| bool ULyraInventoryItemInstance::HasStatTag(FGameplayTag Tag) const | |
| { | |
| return StatTags.ContainsTag(Tag); | |
| } | |
| void ULyraInventoryItemInstance::SetItemDef(TSubclassOf<ULyraInventoryItemDefinition> InDef) | |
| { | |
| ItemDef = InDef; | |
| } | |
| const ULyraInventoryItemFragment* ULyraInventoryItemInstance::FindFragmentByClass(TSubclassOf<ULyraInventoryItemFragment> FragmentClass) const | |
| { | |
| if ((ItemDef != nullptr) && (FragmentClass != nullptr)) | |
| { | |
| return GetDefault<ULyraInventoryItemDefinition>(ItemDef)->FindFragmentByClass(FragmentClass); | |
| } | |
| return nullptr; | |
| } | |