OpenTTD GameScript API 20241224-master-gee860a5c8e
Public Types | Static Public Member Functions
GSGame Class Reference

Class that handles some game related functions. More...

#include <script_game.hpp>

Inheritance diagram for GSGame:

Public Types

enum  LandscapeType {
  LT_TEMPERATE ,
  LT_ARCTIC ,
  LT_TROPIC ,
  LT_TOYLAND
}
 Type of landscapes known in the game. More...
 

Static Public Member Functions

static bool Pause ()
 Pause the server.
 
static bool Unpause ()
 Unpause the server.
 
static bool IsPaused ()
 Check if the game is paused.
 
static LandscapeType GetLandscape ()
 Get the current landscape.
 
static bool IsMultiplayer ()
 Is this a multiplayer game?
 

Detailed Description

Class that handles some game related functions.

Member Enumeration Documentation

◆ LandscapeType

Type of landscapes known in the game.

Enumerator
LT_TEMPERATE 

Temperate climate.

LT_ARCTIC 

Arctic climate.

LT_TROPIC 

Tropic climate.

LT_TOYLAND 

Toyland climate.

Member Function Documentation

◆ GetLandscape()

static LandscapeType GSGame::GetLandscape ( )
static

Get the current landscape.

Returns
The type of landscape.

◆ IsMultiplayer()

static bool GSGame::IsMultiplayer ( )
static

Is this a multiplayer game?

Returns
True if this is a server in a multiplayer game.

◆ IsPaused()

static bool GSGame::IsPaused ( )
static

Check if the game is paused.

Returns
True if and only if the game is paused (by which-ever means).
Note
That a game is paused, doesn't always means you can unpause it. If the game has been manually paused, or because of the pause_on_join in Multiplayer for example, you cannot unpause the game.

◆ Pause()

static bool GSGame::Pause ( )
static

Pause the server.

Returns
True if the action succeeded.

◆ Unpause()

static bool GSGame::Unpause ( )
static

Unpause the server.

Returns
True if the action succeeded.