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

34 lines
702 B
C++

#include "SaveSubsystem.h"
#include "GlobalSaveGameData.h"
#include "ItemSaveRecord.h"
void USaveSubsystem::LoadGame(const FString& SlotName)
{
UGlobalSaveGameData* Save = UGlobalSaveGameData::LoadGame(SlotName);
}
bool USaveSubsystem::SaveGame(const FString& SlotName)
{
return UGlobalSaveGameData::SaveGame(SlotName);
}
void USaveSubsystem::AddItem(const FItemSaveRecord& Record)
{
Items.Add(Record);
}
void USaveSubsystem::RemoveItem(const FGuid& InstanceId)
{
Items.RemoveAll([InstanceId](const FItemSaveRecord& Item)
{
return Item.InstanceId == InstanceId;
});
}
void USaveSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
LoadGame();
}