Download LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.56 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.h
-
curl -L -o LyraInventoryItemInstance.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/LyraInventoryItemInstance.h
2.56 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class FLifetimeProperty; | |
| class ULyraInventoryItemDefinition; | |
| class ULyraInventoryItemFragment; | |
| struct FFrame; | |
| struct FGameplayTag; | |
| /** | |
| * ULyraInventoryItemInstance | |
| */ | |
| UCLASS(BlueprintType) | |
| class ULyraInventoryItemInstance : public UObject | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraInventoryItemInstance(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); | |
| //~UObject interface | |
| virtual bool IsSupportedForNetworking() const override { return true; } | |
| //~End of UObject interface | |
| // Adds a specified number of stacks to the tag (does nothing if StackCount is below 1) | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Inventory) | |
| void AddStatTagStack(FGameplayTag Tag, int32 StackCount); | |
| // Removes a specified number of stacks from the tag (does nothing if StackCount is below 1) | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category= Inventory) | |
| void RemoveStatTagStack(FGameplayTag Tag, int32 StackCount); | |
| // Returns the stack count of the specified tag (or 0 if the tag is not present) | |
| UFUNCTION(BlueprintCallable, Category=Inventory) | |
| int32 GetStatTagStackCount(FGameplayTag Tag) const; | |
| // Returns true if there is at least one stack of the specified tag | |
| UFUNCTION(BlueprintCallable, Category=Inventory) | |
| bool HasStatTag(FGameplayTag Tag) const; | |
| TSubclassOf<ULyraInventoryItemDefinition> GetItemDef() const | |
| { | |
| return ItemDef; | |
| } | |
| UFUNCTION(BlueprintCallable, BlueprintPure=false, meta=(DeterminesOutputType=FragmentClass)) | |
| const ULyraInventoryItemFragment* FindFragmentByClass(TSubclassOf<ULyraInventoryItemFragment> FragmentClass) const; | |
| template <typename ResultClass> | |
| const ResultClass* FindFragmentByClass() const | |
| { | |
| return (ResultClass*)FindFragmentByClass(ResultClass::StaticClass()); | |
| } | |
| private: | |
| /** Register all replication fragments */ | |
| virtual void RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags) override; | |
| void SetItemDef(TSubclassOf<ULyraInventoryItemDefinition> InDef); | |
| friend struct FLyraInventoryList; | |
| private: | |
| UPROPERTY(Replicated) | |
| FGameplayTagStackContainer StatTags; | |
| // The item definition | |
| UPROPERTY(Replicated) | |
| TSubclassOf<ULyraInventoryItemDefinition> ItemDef; | |
| }; | |