// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Containers/Array.h" #include "HAL/Platform.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "Templates/SubclassOf.h" #include "UObject/Interface.h" #include "UObject/ScriptInterface.h" #include "UObject/UObjectGlobals.h" #include "IPickupable.generated.h" class AActor; class ULyraInventoryItemDefinition; class ULyraInventoryItemInstance; class ULyraInventoryManagerComponent; class UObject; struct FFrame; 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) TObjectPtr 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) static TScriptInterface GetFirstPickupableFromActor(AActor* Actor); UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, meta = (WorldContext = "Ability")) static void AddPickupToInventory(ULyraInventoryManagerComponent* InventoryComponent, TScriptInterface Pickup); };