Static Public Member Functions |
static void | init (string game_dir) |
| Initialise the game framework.
|
static void | set_game_data_dir (string game_dir) |
| Specify an additional data directory containing game data.
|
static string | user_data_dir () |
| Returns the absolute path to the user data directory (usually ~/.adonthell).
|
static string | global_data_dir () |
| Returns the absolute path to the global data directory.
|
static string | game_data_dir () |
| Returns the absolute path to the current game's directory (if any).
|
static string | find_file (const string &fname) |
| Finds a file in the directories hierarchy, starting searching from game_data_dir(), then global_data_dir() and finally user_data_dir().
|
static string | find_directory (const string &dirname) |
| Finds a directory in the directories hierarchy, starting searching from game_data_dir(), then global_data_dir() and finally user_data_dir().
|
Static Public Attributes |
static string | User_data_dir |
static string | Global_data_dir |
static string | Game_data_dir |
Holds information about global settings.
This static class should be the first to be initialised in your application, because many others depends on it's correct settings.
Definition at line 47 of file game.h.
string game::find_file |
( |
const string & |
fname | ) |
[static] |
Finds a file in the directories hierarchy, starting searching from game_data_dir(), then global_data_dir() and finally user_data_dir().
If a matching file is found, the full absolute path is returned, else an empty string "" is returned. If the path was already absolute, it is returned immediatly.
- Parameters:
-
fname | name of the find to search for. |
- Returns:
- complete absolute path to the file if found, passed string if the given path was already absolute, or "" if the file wasn't found.
Definition at line 80 of file game.cc.
string game::find_directory |
( |
const string & |
dirname | ) |
[static] |
Finds a directory in the directories hierarchy, starting searching from game_data_dir(), then global_data_dir() and finally user_data_dir().
If a matching directory is found, the full absolute path is returned, else an empty string "" is returned. If the path was already absolute, it is returned immediatly.
- Parameters:
-
fname | name of the find to search for. |
- Returns:
- complete absolute path to the directory if found, passed string if the given path was already absolute, or "" if the directory wasn't found.
Definition at line 102 of file game.cc.