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  */
7 
8 /** @file script_game.hpp Everything to manipulate the current running game. */
9 
10 #ifndef SCRIPT_GAME_HPP
11 #define SCRIPT_GAME_HPP
12 
13 #include "script_object.hpp"
14 #include "../../landscape_type.h"
15 
16 /**
17  * Class that handles some game related functions.
18  * @api game
19  */
20 class ScriptGame : public ScriptObject {
21 public:
22 	/**
23 	 * Type of landscapes known in the game.
24 	 */
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.
31 	};
32 
33 	/**
34 	 * Pause the server.
35 	 * @return True if the action succeeded.
36 	 */
37 	static bool Pause();
38 
39 	/**
40 	 * Unpause the server.
41 	 * @return True if the action succeeded.
42 	 */
43 	static bool Unpause();
44 
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.
51 	 */
52 	static bool IsPaused();
53 
54 	/**
55 	 * Get the current landscape.
56 	 */
57 	static LandscapeType GetLandscape();
58 
59 	/**
60 	 * Is this a multiplayer game?
61 	 * @return True if this is a server in a multiplayer game.
62 	 */
63 	static bool IsMultiplayer();
64 };
65 
66 #endif /* SCRIPT_GAME_HPP */
67