ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

SaveStateDescriptor Class Reference

Object describing a save state. More...

#include <savestate.h>

Collaboration diagram for SaveStateDescriptor:

List of all members.

Public Member Functions

 SaveStateDescriptor ()
 SaveStateDescriptor (int s, const Common::U32String &d)
 SaveStateDescriptor (int s, 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)
 Optional entries only included when querying via MetaEngine::querySaveMetaInfo.
bool getDeletableFlag () const
 Queries whether the save state is allowed to be deleted.
void setWriteProtectedFlag (bool state)
 Defines whether the save state is write protected.
bool getWriteProtectedFlag () const
 Queries whether the save state is write protected.
void setLocked (bool state)
 Defines whether the save state is "locked" because is being synced.
bool getLocked () const
 Queries whether the save state is "locked" because is being synced.
const Graphics::SurfacegetThumbnail () const
 Return a thumbnail graphics surface representing the savestate visually.
void setThumbnail (Graphics::Surface *t)
 Set a thumbnail graphics surface representing the savestate visually.
void setThumbnail (Common::SharedPtr< Graphics::Surface > t)
void setSaveDate (int year, int month, int day)
 Sets the date the save state was created.
const Common::StringgetSaveDate () const
 Queries a human readable description of the date the save state was created.
void setSaveTime (int hour, int min)
 Sets the time the save state was created.
const Common::StringgetSaveTime () const
 Queries a human readable description of the time the save state was created.
void setPlayTime (int hours, int minutes)
 Sets the time the game was played before the save state was created.
void setPlayTime (uint32 msecs)
 Sets the time the game was played before the save state was created.
const Common::StringgetPlayTime () const
 Queries a human readable description of the time the game was played before the save state was created.
uint32 getPlayTimeMSecs () const
 Returns the time the game was played before the save state was created in milliseconds.
void setAutosave (bool autosave)
 Sets whether the save is an autosave.
bool isAutosave () const
 Returns true whether the save is an autosave.

Private Types

enum  SaveType { kSaveTypeUndetermined, kSaveTypeRegular, kSaveTypeAutosave }

Private Attributes

int _slot
 The saveslot id, as it would be passed to the "-x" command line switch.
Common::U32String _description
 A human readable description of the save state.
bool _isDeletable
 Whether the save state can be deleted.
bool _isWriteProtected
 Whether the save state is write protected.
bool _isLocked
 Whether the save state is "locked" because is being synced.
Common::String _saveDate
 Human readable description of the date the save state was created.
Common::String _saveTime
 Human readable description of the time the save state was created.
Common::String _playTime
 Human readable description of the time the game was played till the save state was created.
uint32 _playTimeMSecs
 The time the game was played before the save state was created in milliseconds.
Common::SharedPtr
< Graphics::Surface
_thumbnail
 The thumbnail of the save state.
SaveType _saveType
 Save file type.

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.

Definition at line 46 of file savestate.h.


Member Enumeration Documentation

Enumerator:
kSaveTypeUndetermined 
kSaveTypeRegular 
kSaveTypeAutosave 

Definition at line 48 of file savestate.h.


Constructor & Destructor Documentation

SaveStateDescriptor::SaveStateDescriptor (  ) 

Definition at line 28 of file savestate.cpp.

SaveStateDescriptor::SaveStateDescriptor ( int  s,
const Common::U32String d 
)

Definition at line 35 of file savestate.cpp.

SaveStateDescriptor::SaveStateDescriptor ( int  s,
const Common::String d 
)

Definition at line 41 of file savestate.cpp.


Member Function Documentation

bool SaveStateDescriptor::getDeletableFlag (  )  const [inline]

Queries whether the save state is allowed to be deleted.

Definition at line 89 of file savestate.h.

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

Definition at line 77 of file savestate.h.

bool SaveStateDescriptor::getLocked (  )  const [inline]

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

Definition at line 117 of file savestate.h.

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.

Definition at line 187 of file savestate.h.

uint32 SaveStateDescriptor::getPlayTimeMSecs (  )  const [inline]

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

It defaults to 0.

Definition at line 195 of file savestate.h.

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.

Definition at line 149 of file savestate.h.

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

Definition at line 66 of file savestate.h.

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.

Definition at line 164 of file savestate.h.

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.

Definition at line 125 of file savestate.h.

bool SaveStateDescriptor::getWriteProtectedFlag (  )  const [inline]

Queries whether the save state is write protected.

Definition at line 99 of file savestate.h.

bool SaveStateDescriptor::isAutosave (  )  const

Returns true whether the save is an autosave.

Definition at line 77 of file savestate.cpp.

void SaveStateDescriptor::setAutosave ( bool  autosave  ) 

Sets whether the save is an autosave.

Definition at line 73 of file savestate.cpp.

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.

Definition at line 84 of file savestate.h.

void SaveStateDescriptor::setDescription ( const Common::U32String desc  )  [inline]

Definition at line 72 of file savestate.h.

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

Definition at line 71 of file savestate.h.

void SaveStateDescriptor::setLocked ( bool  state  )  [inline]

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

Definition at line 104 of file savestate.h.

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

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

Parameters:
hours How many hours the user played the game so far.
minutes How many minutes the user played the game so far.

Definition at line 62 of file savestate.cpp.

void SaveStateDescriptor::setPlayTime ( uint32  msecs  ) 

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

Parameters:
msecs How many milliseconds the user played the game so far.

Definition at line 67 of file savestate.cpp.

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

Sets the date the save state was created.

Parameters:
year Year of creation.
month Month of creation.
day Day of creation.

Definition at line 54 of file savestate.cpp.

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

Definition at line 61 of file savestate.h.

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

Sets the time the save state was created.

Parameters:
hour Hour of creation.
min Minute of creation.

Definition at line 58 of file savestate.cpp.

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.

Definition at line 47 of file savestate.cpp.

void SaveStateDescriptor::setThumbnail ( Common::SharedPtr< Graphics::Surface t  )  [inline]

Definition at line 133 of file savestate.h.

void SaveStateDescriptor::setWriteProtectedFlag ( bool  state  )  [inline]

Defines whether the save state is write protected.

Definition at line 94 of file savestate.h.


Member Data Documentation

A human readable description of the save state.

Definition at line 215 of file savestate.h.

Whether the save state can be deleted.

Definition at line 220 of file savestate.h.

Whether the save state is "locked" because is being synced.

Definition at line 230 of file savestate.h.

Whether the save state is write protected.

Definition at line 225 of file savestate.h.

Human readable description of the time the game was played till the save state was created.

Definition at line 246 of file savestate.h.

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

Definition at line 252 of file savestate.h.

Human readable description of the date the save state was created.

Definition at line 235 of file savestate.h.

Human readable description of the time the save state was created.

Definition at line 240 of file savestate.h.

Save file type.

Definition at line 262 of file savestate.h.

The saveslot id, as it would be passed to the "-x" command line switch.

Definition at line 210 of file savestate.h.

The thumbnail of the save state.

Definition at line 257 of file savestate.h.


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


Generated on Sat Sep 19 2020 05:04:11 for ResidualVM by doxygen 1.7.1
curved edge   curved edge