// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "LyraInventoryItemDefinition.h" #include "UObject/Interface.h" #include "IPickupable.generated.h" class ULyraInventoryItemInstance; class ULyraInventoryManagerComponent; USTRUCT(BlueprintType) struct FPickupTemplate { GENERATED_BODY() public: UPROPERTY(EditAnywhere) int32 StackCount = 1; UPROPERTY(EditAnywhere) TSubclassOf ItemDef; }; USTRUCT(BlueprintType) struct FPickupInstance { GENERATED_BODY() public: UPROPERTY(EditAnywhere, BlueprintReadOnly) ULyraInventoryItemInstance* Item = nullptr; }; USTRUCT(BlueprintType) struct FInventoryPickup { GENERATED_BODY() public: UPROPERTY(EditAnywhere, BlueprintReadOnly) TArray Instances; UPROPERTY(EditAnywhere, BlueprintReadOnly) TArray Templates; }; /** */ UINTERFACE(MinimalAPI, BlueprintType, meta = (CannotImplementInterfaceInBlueprint)) class UPickupable : public UInterface { GENERATED_BODY() }; /** */ class IPickupable { GENERATED_BODY() public: UFUNCTION(BlueprintCallable) virtual FInventoryPickup GetPickupInventory() const = 0; }; /** */ UCLASS() class UPickupableStatics : public UBlueprintFunctionLibrary { GENERATED_BODY() public: UPickupableStatics(); public: UFUNCTION(BlueprintPure, meta = (WorldContext = "Ability")) static TScriptInterface GetIPickupableFromActorInfo(UGameplayAbility* Ability); UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, meta = (WorldContext = "Ability")) static void AddPickupInventory(ULyraInventoryManagerComponent* InventoryComponent, TScriptInterface Pickupable); };