OpenTTD Source 20241224-master-gf74b0cf984
FileToSaveLoad Struct Reference

Deals with the type of the savegame, independent of extension. More...

#include <saveload.h>

Public Member Functions

void SetMode (FiosType ft)
 Set the mode and file type of the file to save or load based on the type of file entry at the file system.
 
void SetMode (SaveLoadOperation fop, AbstractFileType aft, DetailedFileType dft)
 Set the mode and file type of the file to save or load.
 
void Set (const FiosItem &item)
 Set the title of the file.
 

Data Fields

SaveLoadOperation file_op
 File operation to perform.
 
DetailedFileType detail_ftype
 Concrete file type (PNG, BMP, old save, etc).
 
AbstractFileType abstract_ftype
 Abstract type of file (scenario, heightmap, etc).
 
std::string name
 Name of the file.
 
std::string title
 Internal name of the game.
 

Detailed Description

Deals with the type of the savegame, independent of extension.

Definition at line 410 of file saveload.h.

Member Function Documentation

◆ Set()

void FileToSaveLoad::Set ( const FiosItem item)

Set the title of the file.

Parameters
titleTitle of the file.

Definition at line 3317 of file saveload.cpp.

References name, SetMode(), and title.

Referenced by SaveLoadWindow::OnClick().

◆ SetMode() [1/2]

void FileToSaveLoad::SetMode ( FiosType  ft)

Set the mode and file type of the file to save or load based on the type of file entry at the file system.

Parameters
ftType of file entry of the file system.

Definition at line 3288 of file saveload.cpp.

References GetAbstractFileType(), GetDetailedFileType(), SetMode(), and SLO_LOAD.

Referenced by openttd_main(), ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DONE(), Set(), and SetMode().

◆ SetMode() [2/2]

void FileToSaveLoad::SetMode ( SaveLoadOperation  fop,
AbstractFileType  aft,
DetailedFileType  dft 
)

Set the mode and file type of the file to save or load.

Parameters
fopFile operation being performed.
aftAbstract file type.
dftDetailed file type.

Definition at line 3299 of file saveload.cpp.

References abstract_ftype, detail_ftype, DFT_INVALID, file_op, FT_INVALID, FT_NONE, and SLO_INVALID.

Field Documentation

◆ abstract_ftype

AbstractFileType FileToSaveLoad::abstract_ftype

Abstract type of file (scenario, heightmap, etc).

Definition at line 413 of file saveload.h.

Referenced by InitializeWindowsAndCaches(), SIGNChunkHandler::Load(), NetworkRestartMap(), and SetMode().

◆ detail_ftype

DetailedFileType FileToSaveLoad::detail_ftype

Concrete file type (PNG, BMP, old save, etc).

Definition at line 412 of file saveload.h.

Referenced by GenerateLandscape(), and SetMode().

◆ file_op

SaveLoadOperation FileToSaveLoad::file_op

File operation to perform.

Definition at line 411 of file saveload.h.

Referenced by SetMode().

◆ name

std::string FileToSaveLoad::name

Name of the file.

Definition at line 414 of file saveload.h.

Referenced by GenerateLandscape(), LoadTownData(), SaveLoadWindow::OnTimeout(), openttd_main(), and Set().

◆ title

std::string FileToSaveLoad::title

Internal name of the game.

Definition at line 415 of file saveload.h.

Referenced by Set().


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