1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00
OpenMW/apps/openmw/mwstate/quicksavemanager.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.1 KiB
C++
Raw Normal View History

#ifndef GAME_STATE_QUICKSAVEMANAGER_H
#define GAME_STATE_QUICKSAVEMANAGER_H
2018-01-12 20:02:43 -05:00
#include <string>
#include "character.hpp"
namespace MWState
{
class QuickSaveManager
{
2018-01-12 20:02:43 -05:00
std::string mSaveName;
unsigned int mMaxSaves;
unsigned int mSlotsVisited;
2018-01-12 20:02:43 -05:00
const Slot* mOldestSlotVisited;
2022-09-22 21:26:05 +03:00
private:
2021-03-29 19:44:23 +02:00
bool shouldCreateNewSlot() const;
bool isOldestSave(const Slot* compare) const;
2022-09-22 21:26:05 +03:00
public:
QuickSaveManager(std::string& saveName, unsigned int maxSaves);
///< A utility class to manage multiple quicksave slots
///
/// \param saveName The name of the save ("QuickSave", "AutoSave", etc)
/// \param maxSaves The maximum number of save slots to create before recycling old ones
void visitSave(const Slot* saveSlot);
///< Visits the given \a slot \a
const Slot* getNextQuickSaveSlot();
///< Get the slot that the next quicksave should use.
///
2018-10-09 10:21:12 +04:00
///\return Either the oldest quicksave slot visited, or nullptr if a new slot can be made
};
}
#endif