Simutrans-Squirrel-API OTRP v63_4
Loading...
Searching...
No Matches
rules Class Reference

Static Public Member Functions

static void forbid_tool (any_x player_nr, any_x tool_id)
static void allow_tool (any_x player_nr, any_x tool_id)
static void forbid_way_tool (any_x player_nr, any_x tool_id, any_x wt)
static void allow_way_tool (any_x player_nr, any_x tool_id, any_x wt)
static void forbid_way_tool_rect (any_x player_nr, any_x tool_id, any_x wt, any_x pos_nw, any_x pos_se, any_x err)
static void allow_way_tool_rect (any_x player_nr, any_x tool_id, any_x wt, any_x pos_nw, any_x pos_se)
static void forbid_way_tool_cube (any_x player_nr, any_x tool_id, any_x wt, any_x pos_nw, any_x pos_se, any_x err)
static void allow_way_tool_cube (any_x player_nr, any_x tool_id, any_x wt, any_x pos_nw, any_x pos_se)
static void clear ()
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()

void rules::allow_tool ( any_x player_nr,
any_x 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()

void rules::allow_way_tool ( any_x player_nr,
any_x tool_id,
any_x 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()

void rules::allow_way_tool_cube ( any_x player_nr,
any_x tool_id,
any_x wt,
any_x pos_nw,
any_x 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()

void rules::allow_way_tool_rect ( any_x player_nr,
any_x tool_id,
any_x wt,
any_x pos_nw,
any_x 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()

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()

void rules::forbid_tool ( any_x player_nr,
any_x 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()

void rules::forbid_way_tool ( any_x player_nr,
any_x tool_id,
any_x 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()

void rules::forbid_way_tool_cube ( any_x player_nr,
any_x tool_id,
any_x wt,
any_x pos_nw,
any_x pos_se,
any_x 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()

void rules::forbid_way_tool_rect ( any_x player_nr,
any_x tool_id,
any_x wt,
any_x pos_nw,
any_x pos_se,
any_x 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()

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: