ScummVM API documentation
SaveStateDescriptor Class Reference

#include <savestate.h>

Public Member Functions

 SaveStateDescriptor (const MetaEngine *metaEngine, int slot, const Common::U32String &d)
 
 SaveStateDescriptor (const MetaEngine *metaEngine, int slot, const Common::String &d)
 
void setSaveSlot (int slot)
 
int getSaveSlot () const
 
void setDescription (const Common::String &desc)
 
void setDescription (const Common::U32String &desc)
 
const Common::U32StringgetDescription () const
 
void setDeletableFlag (bool state)
 
bool getDeletableFlag () const
 
void setWriteProtectedFlag (bool state)
 
bool getWriteProtectedFlag () const
 
void setLocked (bool state)
 
bool getLocked () const
 
const Graphics::SurfacegetThumbnail () const
 
void setThumbnail (Graphics::Surface *t)
 
void setThumbnail (Common::SharedPtr< Graphics::Surface > t)
 
void setSaveDate (int year, int month, int day)
 
const Common::StringgetSaveDate () const
 
void setSaveTime (int hour, int min)
 
const Common::StringgetSaveTime () const
 
void setPlayTime (int hours, int minutes)
 
void setPlayTime (uint32 msecs)
 
const Common::StringgetPlayTime () const
 
uint32 getPlayTimeMSecs () const
 
void setAutosave (bool autosave)
 
bool isAutosave () const
 
bool hasAutosaveName () const
 
bool isValid () const
 

Detailed Description

Object describing a save state.

This at least includes the save slot number and a human readable description of the save state.

Further possibilites are a thumbnail, play time, creation date, creation time, delete protected, write protection.

Saves are writable and deletable by default.

Member Function Documentation

◆ setSaveSlot()

void SaveStateDescriptor::setSaveSlot ( int  slot)
inline
Parameters
slotThe saveslot id, as it would be passed to the "-x" command line switch.

◆ getSaveSlot()

int SaveStateDescriptor::getSaveSlot ( ) const
inline
Returns
The saveslot id, as it would be passed to the "-x" command line switch.

◆ setDescription()

void SaveStateDescriptor::setDescription ( const Common::String desc)
inline
Parameters
descA human readable description of the save state.

◆ getDescription()

const Common::U32String& SaveStateDescriptor::getDescription ( ) const
inline
Returns
A human readable description of the save state.

◆ setDeletableFlag()

void SaveStateDescriptor::setDeletableFlag ( bool  state)
inline

Optional entries only included when querying via MetaEngine::querySaveMetaInfo Defines whether the save state is allowed to be deleted.

◆ getDeletableFlag()

bool SaveStateDescriptor::getDeletableFlag ( ) const
inline

Queries whether the save state is allowed to be deleted.

◆ setWriteProtectedFlag()

void SaveStateDescriptor::setWriteProtectedFlag ( bool  state)
inline

Defines whether the save state is write protected.

◆ getWriteProtectedFlag()

bool SaveStateDescriptor::getWriteProtectedFlag ( ) const
inline

Queries whether the save state is write protected.

◆ setLocked()

void SaveStateDescriptor::setLocked ( bool  state)
inline

Defines whether the save state is "locked" because is being synced.

◆ getLocked()

bool SaveStateDescriptor::getLocked ( ) const
inline

Queries whether the save state is "locked" because is being synced.

◆ getThumbnail()

const Graphics::Surface* SaveStateDescriptor::getThumbnail ( ) const
inline

Return a thumbnail graphics surface representing the savestate visually. This is usually a scaled down version of the game graphics. The size should be either 160x100 or 160x120 pixels, depending on the aspect ratio of the game. If another ratio is required, contact the core team.

◆ setThumbnail()

void SaveStateDescriptor::setThumbnail ( Graphics::Surface t)

Set a thumbnail graphics surface representing the savestate visually. Ownership of the surface is transferred to the SaveStateDescriptor. Hence the caller must not delete the surface.

◆ setSaveDate()

void SaveStateDescriptor::setSaveDate ( int  year,
int  month,
int  day 
)

Sets the date the save state was created.

Parameters
yearYear of creation.
monthMonth of creation.
dayDay of creation.

◆ getSaveDate()

const Common::String& SaveStateDescriptor::getSaveDate ( ) const
inline

Queries a human readable description of the date the save state was created.

This will return an empty string in case the value is not set.

◆ setSaveTime()

void SaveStateDescriptor::setSaveTime ( int  hour,
int  min 
)

Sets the time the save state was created.

Parameters
hourHour of creation.
minMinute of creation.

◆ getSaveTime()

const Common::String& SaveStateDescriptor::getSaveTime ( ) const
inline

Queries a human readable description of the time the save state was created.

This will return an empty string in case the value is not set.

◆ setPlayTime() [1/2]

void SaveStateDescriptor::setPlayTime ( int  hours,
int  minutes 
)

Sets the time the game was played before the save state was created.

Parameters
hoursHow many hours the user played the game so far.
minutesHow many minutes the user played the game so far.

◆ setPlayTime() [2/2]

void SaveStateDescriptor::setPlayTime ( uint32  msecs)

Sets the time the game was played before the save state was created.

Parameters
msecsHow many milliseconds the user played the game so far.

◆ getPlayTime()

const Common::String& SaveStateDescriptor::getPlayTime ( ) const
inline

Queries a human readable description of the time the game was played before the save state was created.

This will return an empty string in case the value is not set.

◆ getPlayTimeMSecs()

uint32 SaveStateDescriptor::getPlayTimeMSecs ( ) const
inline

Returns the time the game was played before the save state was created in milliseconds.

It defaults to 0.

◆ setAutosave()

void SaveStateDescriptor::setAutosave ( bool  autosave)

Sets whether the save is an autosave

◆ isAutosave()

bool SaveStateDescriptor::isAutosave ( ) const

Returns true whether the save is an autosave

◆ hasAutosaveName()

bool SaveStateDescriptor::hasAutosaveName ( ) const

Returns true if the save has an autosave name

◆ isValid()

bool SaveStateDescriptor::isValid ( ) const

Returns true if this entry is valid


The documentation for this class was generated from the following file: