61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Actor.h"
|
|
#include "Engine/DataTable.h"
|
|
#include "HYManualPickUp.h"
|
|
#include "CraftingInfo.h"
|
|
#include "InventoryItem.generated.h"
|
|
|
|
/**
|
|
* Represents an item that can be added to player's inventory
|
|
*/
|
|
USTRUCT(BlueprintType)
|
|
struct FInventoryItem : public FTableRowBase
|
|
{
|
|
GENERATED_BODY();
|
|
public:
|
|
|
|
FInventoryItem();
|
|
|
|
//unique ID for the item
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
FName ItemID;
|
|
|
|
//queue of items that are dropped and spawned back into the world
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
TSubclassOf<class AHYManualPickUp> ItemPickup;
|
|
|
|
//name of the item
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
FText ItemName;
|
|
|
|
//weight of the item
|
|
//(this may not be important, depends on how we re-design the inventory)
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
int32 ItemWeight;
|
|
|
|
//is the item only available through drops?
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
bool OnlyDropped;
|
|
|
|
//can this item be consumed/used?
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
bool CanBeUsed;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
UTexture2D* ItemIcon;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
FText ItemDescription;
|
|
|
|
////all the possible crafting combinations for this particular item
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
TArray<FCraftingInfo> CraftCombinations;
|
|
|
|
bool operator==(const FInventoryItem& OtherItem) const {
|
|
return ItemID == OtherItem.ItemID;
|
|
}
|
|
}; |