From 6846c027f1aaad466af8bcc54b01ee6debb8b6cb Mon Sep 17 00:00:00 2001 From: Ji Yoon Rhee Date: Sat, 22 Jun 2024 09:55:52 +0900 Subject: [PATCH] ^ --- hwanyoung2/Source/hwanyoung2/CraftingInfo.cpp | 5 +++ hwanyoung2/Source/hwanyoung2/CraftingInfo.h | 40 +++++++++++++++++++ hwanyoung2/Source/hwanyoung2/InventoryItem.h | 14 ++++++- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 hwanyoung2/Source/hwanyoung2/CraftingInfo.cpp create mode 100644 hwanyoung2/Source/hwanyoung2/CraftingInfo.h diff --git a/hwanyoung2/Source/hwanyoung2/CraftingInfo.cpp b/hwanyoung2/Source/hwanyoung2/CraftingInfo.cpp new file mode 100644 index 00000000..4e8a23e9 --- /dev/null +++ b/hwanyoung2/Source/hwanyoung2/CraftingInfo.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "CraftingInfo.h" + diff --git a/hwanyoung2/Source/hwanyoung2/CraftingInfo.h b/hwanyoung2/Source/hwanyoung2/CraftingInfo.h new file mode 100644 index 00000000..0acae582 --- /dev/null +++ b/hwanyoung2/Source/hwanyoung2/CraftingInfo.h @@ -0,0 +1,40 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Engine/DataTable.h" +#include "CraftingInfo.generated.h" + +/** + * + */ +USTRUCT(BlueprintType) +struct FCraftingInfo : public FTableRowBase +{ + GENERATED_BODY(); + +public: + + //unique ID of item that is being used to create the item + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName ComponentID; + + //unique ID of the item that gets created + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName ProductID; + + //do we want to destroy the component? + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bDestroyItemA; + + // + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bDestroyItemB; + + bool operator==(const FCraftingInfo& OtherItem) const { + return ComponentID == OtherItem.ComponentID; + } + + +}; \ No newline at end of file diff --git a/hwanyoung2/Source/hwanyoung2/InventoryItem.h b/hwanyoung2/Source/hwanyoung2/InventoryItem.h index 1a61a4a6..f81e44f2 100644 --- a/hwanyoung2/Source/hwanyoung2/InventoryItem.h +++ b/hwanyoung2/Source/hwanyoung2/InventoryItem.h @@ -6,10 +6,11 @@ #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 @@ -23,6 +24,7 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite) FName ItemID; + //queue of items that are dropped and spawned back into the world UPROPERTY(EditAnywhere, BlueprintReadWrite) TSubclassOf ItemPickup; @@ -39,13 +41,21 @@ public: 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 CraftCombinations; + bool operator==(const FInventoryItem& OtherItem) const { return ItemID == OtherItem.ItemID; } -}; +}; \ No newline at end of file