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.cpp Implementation of ScriptGame. */
9 
10 #include "../../stdafx.h"
11 #include "script_game.hpp"
12 #include "../../command_type.h"
13 #include "../../settings_type.h"
14 #include "../../network/network.h"
15 
16 #include "../../safeguards.h"
17 
Pause()18 /* static */ bool ScriptGame::Pause()
19 {
20 	return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 1, CMD_PAUSE);
21 }
22 
Unpause()23 /* static */ bool ScriptGame::Unpause()
24 {
25 	return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 0, CMD_PAUSE);
26 }
27 
IsPaused()28 /* static */ bool ScriptGame::IsPaused()
29 {
30 	return !!_pause_mode;
31 }
32 
GetLandscape()33 /* static */ ScriptGame::LandscapeType ScriptGame::GetLandscape()
34 {
35 	return (ScriptGame::LandscapeType)_settings_game.game_creation.landscape;
36 }
37 
IsMultiplayer()38 /* static */ bool ScriptGame::IsMultiplayer()
39 {
40 	return _network_server;
41 }
42