This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Source/AgrarianGame/AgrarianPersistentActorComponent.h

39 lines
1.2 KiB
C++

// Copyright Pacificao. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "AgrarianSaveGame.h"
#include "AgrarianPersistentActorComponent.generated.h"
UCLASS(ClassGroup = (Agrarian), BlueprintType, Blueprintable, meta = (BlueprintSpawnableComponent))
class UAgrarianPersistentActorComponent : public UActorComponent
{
GENERATED_BODY()
public:
UAgrarianPersistentActorComponent();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
FName ActorTypeId = NAME_None;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
bool bSaveTransform = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
TMap<FName, FString> StringState;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
TMap<FName, float> NumberState;
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
bool IsSaveable() const;
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
FAgrarianSavedWorldActor CaptureSaveState() const;
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
void ApplySaveState(const FAgrarianSavedWorldActor& SavedActor);
};