Simutrans-Squirrel-API
Public Member Functions | Static Public Member Functions | List of all members
player_x Class Reference
Inheritance diagram for player_x:
extend_get ingame_object

Public Member Functions

void book_cash (integer delta)
 
void create_line (way_types wt)
 
array< integer > get_assets ()
 
array< integer > get_cash ()
 
array< integer > get_construction ()
 
array< integer > get_convoys ()
 
float get_current_cash ()
 
integer get_current_maintenance ()
 
integer get_current_net_wealth ()
 
integer get_headquarter_level ()
 
coord get_headquarter_pos ()
 
array< integer > get_income ()
 
line_list_x get_line_list ()
 
array< integer > get_maintenance ()
 
array< integer > get_margin ()
 
string get_name ()
 
array< integer > get_net_wealth ()
 
array< integer > get_new_vehicles ()
 
array< integer > get_operating_profit ()
 
array< integer > get_powerline ()
 
array< integer > get_profit ()
 
array< integer > get_transported ()
 
array< integer > get_transported_goods ()
 
array< integer > get_transported_mail ()
 
array< integer > get_transported_pax ()
 
integer get_type ()
 
array< integer > get_vehicle_maint ()
 
array< integer > get_way_tolls ()
 
bool is_active ()
 
bool is_valid ()
 
 player_x (integer nr)
 
void set_name (string name)
 

Static Public Member Functions

static player_x self ()
 

Detailed Description

Class to access player statistics. Here, a player refers to one transport company, not to an individual playing simutrans.

Definition at line 6 of file api_player.cc.

Constructor & Destructor Documentation

◆ player_x()

player_x::player_x ( integer  nr)

Constructor.

Parameters
nrplayer number, 0 = standard player, 1 = public player

Member Function Documentation

◆ get_assets()

array<integer> player_x::get_assets ( )

Get monthly statistics of assets.

Returns
array, index [0] corresponds to current month

◆ get_cash()

array<integer> player_x::get_cash ( )

Get monthly statistics of cash.

Returns
array, index [0] corresponds to current month

◆ get_construction()

array<integer> player_x::get_construction ( )

Get monthly statistics of construction costs.

Returns
array, index [0] corresponds to current month

◆ get_convoys()

array<integer> player_x::get_convoys ( )

Get monthly statistics of number of convoys.

Returns
array, index [0] corresponds to current month

◆ get_current_cash()

float player_x::get_current_cash ( )

Returns the current account balance.

◆ get_current_maintenance()

integer player_x::get_current_maintenance ( )

Returns the current maintenance [in 1/100 cr].

◆ get_current_net_wealth()

integer player_x::get_current_net_wealth ( )

Returns the current net worth [in 1/100 cr].

◆ get_headquarter_level()

integer player_x::get_headquarter_level ( )

Return headquarters level.

Returns
level, level is zero if no headquarters was built

◆ get_headquarter_pos()

coord player_x::get_headquarter_pos ( )

Return headquarters position.

Returns
coordinate, (-1,-1) if no headquarters was built

◆ get_income()

array<integer> player_x::get_income ( )

Get monthly statistics of income.

Returns
array, index [0] corresponds to current month

◆ get_line_list()

line_list_x player_x::get_line_list ( )

Exports list of lines of this player.

◆ get_maintenance()

array<integer> player_x::get_maintenance ( )

Get monthly statistics of infrastructure maintenance.

Returns
array, index [0] corresponds to current month

◆ get_margin()

array<integer> player_x::get_margin ( )

Get monthly statistics of margin.

Returns
array, index [0] corresponds to current month

◆ get_name()

string player_x::get_name ( )

Return name of company.

Returns
name

◆ get_net_wealth()

array<integer> player_x::get_net_wealth ( )

Get monthly statistics of net wealth.

Returns
array, index [0] corresponds to current month

◆ get_new_vehicles()

array<integer> player_x::get_new_vehicles ( )

Get monthly statistics of costs for vehicle purchase.

Returns
array, index [0] corresponds to current month

◆ get_operating_profit()

array<integer> player_x::get_operating_profit ( )

Get monthly statistics of operating profit.

Returns
array, index [0] corresponds to current month

◆ get_powerline()

array<integer> player_x::get_powerline ( )

Get monthly statistics of income from powerlines.

Returns
array, index [0] corresponds to current month

◆ get_profit()

array<integer> player_x::get_profit ( )

Get monthly statistics of profit.

Returns
array, index [0] corresponds to current month

◆ get_transported()

array<integer> player_x::get_transported ( )

Get monthly statistics of all transported goods.

Returns
array, index [0] corresponds to current month

◆ get_transported_goods()

array<integer> player_x::get_transported_goods ( )

Get monthly statistics of transported goods.

Returns
array, index [0] corresponds to current month

◆ get_transported_mail()

array<integer> player_x::get_transported_mail ( )

Get monthly statistics of transported mail.

Returns
array, index [0] corresponds to current month

◆ get_transported_pax()

array<integer> player_x::get_transported_pax ( )

Get monthly statistics of transported passengers.

Returns
array, index [0] corresponds to current month

◆ get_type()

integer player_x::get_type ( )

Returns player type: 1 = human, 2,3 = old c++ AI, 4 = scripted AI

◆ get_vehicle_maint()

array<integer> player_x::get_vehicle_maint ( )

Get monthly statistics of vehicle running costs.

Returns
array, index [0] corresponds to current month

◆ get_way_tolls()

array<integer> player_x::get_way_tolls ( )

Get monthly statistics of income/loss due to way tolls.

Returns
array, index [0] corresponds to current month

◆ is_active()

bool player_x::is_active ( )

Returns whether the player (still) exists in the game.

Deprecated:
Only available for api versions less than 120.1, see get_api_version.

◆ is_valid()

bool player_x::is_valid ( )
Returns
if object is still valid.

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