|
|
|
|
| #pragma once
|
|
|
| #include "System/GameplayTagStack.h"
|
| #include "Templates/SubclassOf.h"
|
|
|
| #include "LyraInventoryItemInstance.generated.h"
|
|
|
| class FLifetimeProperty;
|
|
|
| class ULyraInventoryItemDefinition;
|
| class ULyraInventoryItemFragment;
|
| struct FFrame;
|
| struct FGameplayTag;
|
|
|
| |
| |
|
|
| UCLASS(BlueprintType)
|
| class ULyraInventoryItemInstance : public UObject
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| ULyraInventoryItemInstance(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
|
|
| virtual bool IsSupportedForNetworking() const override { return true; }
|
|
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Inventory)
|
| void AddStatTagStack(FGameplayTag Tag, int32 StackCount);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category= Inventory)
|
| void RemoveStatTagStack(FGameplayTag Tag, int32 StackCount);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Inventory)
|
| int32 GetStatTagStackCount(FGameplayTag Tag) const;
|
|
|
|
|
| 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:
|
| #if UE_WITH_IRIS
|
|
|
| virtual void RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags) override;
|
| #endif
|
|
|
| void SetItemDef(TSubclassOf<ULyraInventoryItemDefinition> InDef);
|
|
|
| friend struct FLyraInventoryList;
|
|
|
| private:
|
| UPROPERTY(Replicated)
|
| FGameplayTagStackContainer StatTags;
|
|
|
|
|
| UPROPERTY(Replicated)
|
| TSubclassOf<ULyraInventoryItemDefinition> ItemDef;
|
| };
|
|
|