FilePath

A namespace that provides correct file paths for various types of game data stored on disk.

Project

DatabaseCore

Include

FilePath.h

Summary
A namespace that provides correct file paths for various types of game data stored on disk.
Provides a full path to a .tex file.
Provides a full path to a data file.
Provides a full path to a sound file.

Functions

Tex

wxString DATABASE_EXPORT_SPEC Tex(const wxString &filename)

Provides a full path to a .tex file.  Tex files are by default stored in the /tex directory.  However, the user may have selected an alternate subdirectory under /tex for custom tiles.  This function determines if the given file is in the custom directory (if any) and returns the path to it if it exists, or the path to the default version of the .tex file if not.

Parameters

filenameThe name of the .tex file desired.

Returns

A wxString containing the full path to the .tex file.

Data

wxString DATABASE_EXPORT_SPEC Data(const DataFileType type)

Provides a full path to a data file.  Data files include the game and player databases, as well as the map database.

Parameters

filenameThe type of the data file desired.

Returns

A wxString containing the full path to the data file.

Sound

wxString DATABASE_EXPORT_SPEC Sound(const wxString &filename)

Provides a full path to a sound file.  Sound files are by default stored in the /sounds directory.  However, the user may have selected an alternate subdirectory under /sounds for custom sounds.  This function determines if the given file is in the custom directory (if any) and returns the path to it if it exists, or the path to the default version of the sound if not.

Parameters

filenameThe name of the sound file desired.

Returns

A wxString containing the full path to the sound file.

wxString DATABASE_EXPORT_SPEC Tex(const wxString &filename)
Provides a full path to a .tex file.
wxString DATABASE_EXPORT_SPEC Data(const DataFileType type)
Provides a full path to a data file.
wxString DATABASE_EXPORT_SPEC Sound(const wxString &filename)
Provides a full path to a sound file.
DatabaseCore provides a set of commonly used Singletons and namespaces that handle important, but mundane aspects of game management, such as available player colors, configuration options, image maniplulation, file paths, and playing sounds.