/
ChompSaveGame.h
45 lines (33 loc) · 982 Bytes
/
ChompSaveGame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/SaveGame.h"
#include "ChompSaveGame.generated.h"
class ULevelDataAsset;
UCLASS(BlueprintType, Blueprintable)
class CHOMP_API UChompSaveGame : public USaveGame
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, Category = "High Score")
int HighScore = 0;
UPROPERTY(EditAnywhere, Category = "High Score")
ULevelDataAsset* HighScoreLevel;
UPROPERTY(Transient)
bool IsDirty;
public:
static UChompSaveGame* Load(
const FString SaveSlotName = TEXT("ChompSaveSlot"),
const int UserIndex = 0
);
void Save(
const FString SaveSlotName = TEXT("ChompSaveSlot"),
const int UserIndex = 0
);
UFUNCTION(BlueprintCallable)
int GetHighScore() const;
UFUNCTION(BlueprintCallable)
void SetHighScore(const int NewHighScore, ULevelDataAsset* NewHighScoreLevel);
UFUNCTION(BlueprintCallable)
bool IsHighScoreNew() const;
UFUNCTION(BlueprintCallable)
TSubclassOf<UUserWidget> GetHighScoreLevelWidget() const;
};