Update: Translations from eints
[openttd-github.git] / src / script / api / script_game.cpp
blobd338837f1498221fb0bdde97391b502c4fbf1c8d
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.cpp Implementation of ScriptGame. */
10 #include "../../stdafx.h"
11 #include "script_game.hpp"
12 #include "script_error.hpp"
13 #include "../../command_type.h"
14 #include "../../settings_type.h"
15 #include "../../network/network.h"
16 #include "../../misc_cmd.h"
18 #include "../../safeguards.h"
20 /* static */ bool ScriptGame::Pause()
22 return ScriptObject::Command<CMD_PAUSE>::Do(PM_PAUSED_GAME_SCRIPT, true);
25 /* static */ bool ScriptGame::Unpause()
27 return ScriptObject::Command<CMD_PAUSE>::Do(PM_PAUSED_GAME_SCRIPT, false);
30 /* static */ bool ScriptGame::IsPaused()
32 return !!_pause_mode;
35 /* static */ ScriptGame::LandscapeType ScriptGame::GetLandscape()
37 return (ScriptGame::LandscapeType)_settings_game.game_creation.landscape;
40 /* static */ bool ScriptGame::IsMultiplayer()
42 return _network_server;