OpenTTD Source  20241108-master-g80f628063a
FiosNumberedSaveName Struct Reference

A savegame name automatically numbered. More...

#include <fios.h>

Public Member Functions

 FiosNumberedSaveName (const std::string &prefix)
 Constructs FiosNumberedSaveName. More...
 
std::string Filename ()
 Generate a savegame name and number according to _settings_client.gui.max_num_autosaves. More...
 
std::string Extension ()
 Generate an extension for a savegame name. More...
 

Private Attributes

std::string prefix
 
int number
 

Detailed Description

A savegame name automatically numbered.

Definition at line 130 of file fios.h.

Constructor & Destructor Documentation

◆ FiosNumberedSaveName()

FiosNumberedSaveName::FiosNumberedSaveName ( const std::string &  prefix)

Constructs FiosNumberedSaveName.

Initial number is the most recent save, or -1 if not found.

Parameters
prefixThe prefix to use to generate a filename.

< Static as the lambda needs access to it.

Definition at line 727 of file fios.cpp.

Member Function Documentation

◆ Extension()

std::string FiosNumberedSaveName::Extension ( )

Generate an extension for a savegame name.

Returns
An extension in format "-<prefix>.sav".

Definition at line 774 of file fios.cpp.

Referenced by DoAutoOrNetsave().

◆ Filename()

std::string FiosNumberedSaveName::Filename ( )

Generate a savegame name and number according to _settings_client.gui.max_num_autosaves.

Returns
A filename in format "<prefix><number>.sav".

Definition at line 764 of file fios.cpp.

References _settings_client, ClientSettings::gui, and GUISettings::max_num_autosaves.

Referenced by DoAutoOrNetsave().


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