This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src/client/SaveFile.h
2023-05-11 12:40:23 +02:00

30 lines
713 B
C++

#pragma once
#include "common/String.h"
#include <memory>
class GameSave;
class SaveFile {
public:
SaveFile(ByteString filename, bool newLazyLoad = false);
const GameSave *LazyGetGameSave();
const GameSave *GetGameSave() const;
std::unique_ptr<GameSave> TakeGameSave();
void SetGameSave(std::unique_ptr<GameSave> newSameSave);
const String &GetDisplayName() const;
void SetDisplayName(String displayName);
const ByteString &GetName() const;
void SetFileName(ByteString fileName);
const String &GetError() const;
void SetLoadingError(String error);
void LazyUnload();
private:
std::unique_ptr<GameSave> gameSave;
ByteString filename;
String displayName;
String loadingError;
bool lazyLoad;
};