Simutrans-Squirrel-API
Static Public Member Functions | List of all members
rules Class Reference

Static Public Member Functions

static void allow_tool (integer player_nr, integer tool_id)
 
static void allow_way_tool (integer player_nr, integer tool_id, way_types wt)
 
static void allow_way_tool_cube (integer player_nr, integer tool_id, way_types wt, coord3d pos_nw, coord3d pos_se)
 
static void allow_way_tool_rect (integer player_nr, integer tool_id, way_types wt, coord pos_nw, coord pos_se)
 
static void clear ()
 
static void forbid_tool (integer player_nr, integer tool_id)
 
static void forbid_way_tool (integer player_nr, integer tool_id, way_types wt)
 
static void forbid_way_tool_cube (integer player_nr, integer tool_id, way_types wt, coord3d pos_nw, coord3d pos_se, string err)
 
static void forbid_way_tool_rect (integer player_nr, integer tool_id, way_types wt, coord pos_nw, coord pos_se, string err)
 
static void gui_needs_update ()
 

Detailed Description

Table with methods to forbid and allow tools.

Tools that are set to forbidden using the forbid_* methods can be allowed again by calls to the respective allow_* method with exact the same parameters.

Note
Only available in scenario mode.

Definition at line 74 of file api_scenario.cc.

Member Function Documentation

◆ allow_tool()

static void rules::allow_tool ( integer  player_nr,
integer  tool_id 
)
static

Allow tool.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
See also
tool_ids way_types player_all

◆ allow_way_tool()

static void rules::allow_way_tool ( integer  player_nr,
integer  tool_id,
way_types  wt 
)
static

Allow tool with certain waytype.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
wtwaytype
See also
tool_ids way_types player_all

◆ allow_way_tool_cube()

static void rules::allow_way_tool_cube ( integer  player_nr,
integer  tool_id,
way_types  wt,
coord3d  pos_nw,
coord3d  pos_se 
)
static

Allow tool with certain waytype within cubic region on the map.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
wtwaytype
pos_nw3d-coordinate of north-western corner of cube
pos_se3d-coordinate of south-eastern corner of cube
See also
tool_ids way_types player_all

◆ allow_way_tool_rect()

static void rules::allow_way_tool_rect ( integer  player_nr,
integer  tool_id,
way_types  wt,
coord  pos_nw,
coord  pos_se 
)
static

Allow tool with certain waytype within rectangular region on the map.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
wtwaytype
pos_nwcoordinate of north-western corner of rectangle
pos_secoordinate of south-eastern corner of rectangle
See also
tool_ids way_types player_all

◆ clear()

static void rules::clear ( )
static

Clear all forbidding rules, effectively allowing all tools again that were forbidden using functions of the table rules.

Only effects tools forbidden by rules::forbid_tool, rules::forbid_way_tool, rules::forbid_way_tool_cube, rules::forbid_way_tool_rect. The result of is_tool_allowed and is_work_allowed_here is not influenced.

◆ forbid_tool()

static void rules::forbid_tool ( integer  player_nr,
integer  tool_id 
)
static

Forbid tool.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
See also
tool_ids way_types player_all

◆ forbid_way_tool()

static void rules::forbid_way_tool ( integer  player_nr,
integer  tool_id,
way_types  wt 
)
static

Forbid tool with certain waytype.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
wtwaytype
See also
tool_ids way_types player_all

◆ forbid_way_tool_cube()

static void rules::forbid_way_tool_cube ( integer  player_nr,
integer  tool_id,
way_types  wt,
coord3d  pos_nw,
coord3d  pos_se,
string  err 
)
static

Forbid tool with certain waytype within cubic region on the map.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
wtwaytype
pos_nw3d-coordinate of north-western corner of cube
pos_se3d-coordinate of south-eastern corner of cube
errerror message presented to user when trying to apply this tool, see also is_work_allowed_here
See also
tool_ids way_types player_all

◆ forbid_way_tool_rect()

static void rules::forbid_way_tool_rect ( integer  player_nr,
integer  tool_id,
way_types  wt,
coord  pos_nw,
coord  pos_se,
string  err 
)
static

Forbid tool with certain waytype within rectangular region on the map.

Parameters
player_nrnumber of player this rule applies to, if this is set to player_all then this acts for all players except public player
tool_idid of tool
wtwaytype
pos_nwcoordinate of north-western corner of rectangle
pos_secoordinate of south-eastern corner of rectangle
errerror message presented to user when trying to apply this tool, see also is_work_allowed_here
See also
tool_ids way_types player_all

◆ gui_needs_update()

static void rules::gui_needs_update ( )
static

Signals that toolbars and active tools need to be checked against scenario rules again.


The documentation for this class was generated from the following file: