Esempio n. 1
0
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);
}
Esempio n. 2
0
// 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;
}
Esempio n. 3
0
void Verify(int slot)
{
	VerifyAt(MakeStateFilename(slot));
}
Esempio n. 4
0
void Load(int slot)
{
	LoadAs(MakeStateFilename(slot));
}
Esempio n. 5
0
void Save(int slot)
{
	SaveAs(MakeStateFilename(slot));
}
Esempio n. 6
0
void Save(int slot, bool wait)
{
  SaveAs(MakeStateFilename(slot), wait);
}