Files
Naked-Desire/Source/NakedDesire/Clothing/ClothingItemInstance.cpp
T
2026-06-03 15:16:21 +03:00

28 lines
866 B
C++

#include "ClothingItemInstance.h"
#include "ClothingItem.h"
#include "NakedDesire/SaveGame/ItemSaveRecord.h"
void UClothingItemInstance::Init(UClothingItem* InClothingItem)
{
ClothingItem = InClothingItem;
}
void UClothingItemInstance::Setup(UClothingItem* InClothingItem, const TArray<UItemInstance*>& InStoredItems,
const float InCondition, const FGuid InInstanceId)
{
this->ClothingItem = InClothingItem;
this->StoredItems = InStoredItems;
this->Condition = InCondition;
this->InstanceId = InInstanceId;
}
UClothingItemInstance* UClothingItemInstance::CreateFromSave(UObject* Outer, const FItemSaveRecord& ItemSaveRecord)
{
UClothingItemInstance* NewItemInstance = NewObject<UClothingItemInstance>(Outer);
NewItemInstance->Setup(ItemSaveRecord.Definition.Get(), {}, ItemSaveRecord.Condition, ItemSaveRecord.InstanceId);
return NewItemInstance;
}