Fix some daylength issues, possible division by zero in main menu.
[openttd-joker.git] / src / script / api / script_game.hpp
blob79c6b83abdf483175337f3658a7005a1c7f356cd
1 /* $Id: script_game.hpp 24900 2013-01-08 22:46:42Z planetmaker $ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file script_game.hpp Everything to manipulate the current running game. */
12 #ifndef SCRIPT_GAME_HPP
13 #define SCRIPT_GAME_HPP
15 #include "script_object.hpp"
16 #include "../../landscape_type.h"
18 /**
19 * Class that handles some game related functions.
20 * @api game
22 class ScriptGame : public ScriptObject {
23 public:
24 /**
25 * Type of landscapes known in the game.
27 enum LandscapeType {
28 /* Note: these values represent part of the in-game LandscapeType enum */
29 LT_TEMPERATE = ::LT_TEMPERATE, ///< Temperate climate.
30 LT_ARCTIC = ::LT_ARCTIC, ///< Arctic climate.
31 LT_TROPIC = ::LT_TROPIC, ///< Tropic climate.
32 LT_TOYLAND = ::LT_TOYLAND, ///< Toyland climate.
35 /**
36 * Pause the server.
37 * @return True if the action succeeded.
39 static bool Pause();
41 /**
42 * Unpause the server.
43 * @return True if the action succeeded.
45 static bool Unpause();
47 /**
48 * Check if the game is paused.
49 * @return True if and only if the game is paused (by which-ever means).
50 * @note That a game is paused, doesn't always means you can unpause it. If
51 * the game has been manually paused, or because of the pause_on_join in
52 * Multiplayer for example, you cannot unpause the game.
54 static bool IsPaused();
56 /**
57 * Get the current landscape.
59 static LandscapeType GetLandscape();
61 /**
62 * Is this a multiplayer game?
63 * @return True if this is a server in a multiplayer game.
65 static bool IsMultiplayer();
68 #endif /* SCRIPT_GAME_HPP */