Update: Translations from eints
[openttd-github.git] / src / script / api / script_game.hpp
blobb5fd62c524f8822eefcd93b1d54ea359d96f3793
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file script_game.hpp Everything to manipulate the current running game. */
10 #ifndef SCRIPT_GAME_HPP
11 #define SCRIPT_GAME_HPP
13 #include "script_object.hpp"
14 #include "../../landscape_type.h"
16 /**
17 * Class that handles some game related functions.
18 * @api game
20 class ScriptGame : public ScriptObject {
21 public:
22 /**
23 * Type of landscapes known in the game.
25 enum LandscapeType {
26 /* Note: these values represent part of the in-game LandscapeType enum */
27 LT_TEMPERATE = ::LT_TEMPERATE, ///< Temperate climate.
28 LT_ARCTIC = ::LT_ARCTIC, ///< Arctic climate.
29 LT_TROPIC = ::LT_TROPIC, ///< Tropic climate.
30 LT_TOYLAND = ::LT_TOYLAND, ///< Toyland climate.
33 /**
34 * Pause the server.
35 * @return True if the action succeeded.
37 static bool Pause();
39 /**
40 * Unpause the server.
41 * @return True if the action succeeded.
43 static bool Unpause();
45 /**
46 * Check if the game is paused.
47 * @return True if and only if the game is paused (by which-ever means).
48 * @note That a game is paused, doesn't always means you can unpause it. If
49 * the game has been manually paused, or because of the pause_on_join in
50 * Multiplayer for example, you cannot unpause the game.
52 static bool IsPaused();
54 /**
55 * Get the current landscape.
56 * @return The type of landscape.
58 static LandscapeType GetLandscape();
60 /**
61 * Is this a multiplayer game?
62 * @return True if this is a server in a multiplayer game.
64 static bool IsMultiplayer();
67 #endif /* SCRIPT_GAME_HPP */