28 lines
866 B
C++
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;
|
|
}
|