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

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

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

Constructor.

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

Member Function Documentation

array<integer> player_x::get_assets ( )

Get monthly statistics of assets.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_cash ( )

Get monthly statistics of cash.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_construction ( )

Get monthly statistics of construction costs.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_convoys ( )

Get monthly statistics of number of convoys.

Returns
array, index [0] corresponds to current month
float player_x::get_current_cash ( )

Returns the current account balance.

integer player_x::get_current_maintenance ( )

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

integer player_x::get_current_net_wealth ( )

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

integer player_x::get_headquarter_level ( )

Return headquarters level.

Returns
level, level is zero if no headquarters was built
coord player_x::get_headquarter_pos ( )

Return headquarters position.

Returns
coordinate, (-1,-1) if no headquarters was built
array<integer> player_x::get_income ( )

Get monthly statistics of income.

Returns
array, index [0] corresponds to current month
line_list_x player_x::get_line_list ( )

Exports list of lines of this player.

array<integer> player_x::get_maintenance ( )

Get monthly statistics of infrastructure maintenance.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_margin ( )

Get monthly statistics of margin.

Returns
array, index [0] corresponds to current month
string player_x::get_name ( )

Return name of company.

Returns
name
array<integer> player_x::get_net_wealth ( )

Get monthly statistics of net wealth.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_new_vehicles ( )

Get monthly statistics of costs for vehicle purchase.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_operating_profit ( )

Get monthly statistics of operating profit.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_powerline ( )

Get monthly statistics of income from powerlines.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_profit ( )

Get monthly statistics of profit.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_transported ( )

Get monthly statistics of all transported goods.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_transported_goods ( )

Get monthly statistics of transported goods.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_transported_mail ( )

Get monthly statistics of transported mail.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_transported_pax ( )

Get monthly statistics of transported passengers.

Returns
array, index [0] corresponds to current month
array<integer> player_x::get_vehicle_maint ( )

Get monthly statistics of vehicle running costs.

Returns
array, index [0] corresponds to current month
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
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.
bool player_x::is_valid ( )
Returns
if object is still valid.

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