script_game.cpp

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #include "../../stdafx.h"
00013 #include "script_game.hpp"
00014 #include "../../command_type.h"
00015 #include "../../settings_type.h"
00016 #include "../../openttd.h"
00017 #include "../../network/network.h"
00018 
00019 /* static */ bool ScriptGame::Pause()
00020 {
00021   return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 1, CMD_PAUSE);
00022 }
00023 
00024 /* static */ bool ScriptGame::Unpause()
00025 {
00026   return ScriptObject::DoCommand(0, PM_PAUSED_GAME_SCRIPT, 0, CMD_PAUSE);
00027 }
00028 
00029 /* static */ bool ScriptGame::IsPaused()
00030 {
00031   return !!_pause_mode;
00032 }
00033 
00034 /* static */ ScriptGame::LandscapeType ScriptGame::GetLandscape()
00035 {
00036   return (ScriptGame::LandscapeType)_settings_game.game_creation.landscape;
00037 }
00038 
00039 /* static */ bool ScriptGame::IsMultiplayer()
00040 {
00041 #ifdef ENABLE_NETWORK
00042   return _network_server;
00043 #else
00044   return false;
00045 #endif
00046 }