std::string GetInfoStringOfSlot(int slot, bool translate) { std::string filename = MakeStateFilename(slot); if (!File::Exists(filename)) return translate ? GetStringT("Empty") : "Empty"; State::StateHeader header; if (!ReadHeader(filename, header)) return translate ? GetStringT("Unknown") : "Unknown"; return Common::Timer::GetDateTimeFormatted(header.time); }
// read state timestamps static std::map<double, int> GetSavedStates() { StateHeader header; std::map<double, int> m; for (int i = 1; i <= (int)NUM_STATES; i++) { std::string filename = MakeStateFilename(i); if (File::Exists(filename)) { if (ReadHeader(filename, header)) { double d = Common::Timer::GetDoubleTime() - header.time; // increase time until unique value is obtained while (m.find(d) != m.end()) d += .001; m.insert(std::pair<double,int>(d, i)); } } } return m; }
void Verify(int slot) { VerifyAt(MakeStateFilename(slot)); }
void Load(int slot) { LoadAs(MakeStateFilename(slot)); }
void Save(int slot) { SaveAs(MakeStateFilename(slot)); }
void Save(int slot, bool wait) { SaveAs(MakeStateFilename(slot), wait); }