# settings_type.h

Go to the documentation of this file.

    00001 /* $Id: settings_type.h 16059 2009-04-14 21:07:33Z rubidium $ */
    00002
    00005 #ifndef SETTINGS_TYPE_H
    00006 #define SETTINGS_TYPE_H
    00007
    00008 #include "date_type.h"
    00009 #include "town_type.h"
    00010 #include "transport_type.h"
    00011 #include "network/core/config.h"
    00012 #include "company_type.h"
    00013
    00015 struct DifficultySettings {
    00016   byte   max_no_competitors;
    00017   byte   number_towns;
    00018   byte   number_industries;
    00019   uint32 max_loan;
    00020   byte   initial_interest;
    00021   byte   vehicle_costs;
    00022   byte   competitor_speed;
    00023   byte   vehicle_breakdowns;
    00024   byte   subsidy_multiplier;
    00025   byte   construction_cost;
    00026   byte   terrain_type;
    00027   byte   quantity_sea_lakes;
    00028   byte   economy;
    00029   byte   line_reverse_mode;
    00030   byte   disasters;
    00031   byte   town_council_tolerance;
    00032   byte   diff_level;
    00033 };
    00034
    00036 struct GUISettings {
    00037   bool   vehicle_speed;
    00038   bool   sg_full_load_any;
    00039   bool   lost_train_warn;
    00040   uint8  order_review_system;
    00041   bool   vehicle_income_warn;
    00042   bool   status_long_date;
    00043   bool   show_finances;
    00044   bool   sg_new_nonstop;
    00045   bool   new_nonstop;
    00046   bool   autoscroll;
    00047   byte   errmsg_duration;
    00048   bool   link_terraform_toolbar;
    00049   bool   reverse_scroll;
    00050   bool   smooth_scroll;
    00051   bool   measure_tooltip;
    00052   byte   liveries;
    00053   bool   prefer_teamchat;
    00054   uint8  advanced_vehicle_list;
    00055   uint8  loading_indicators;
    00056   uint8  default_rail_type;
    00057   uint8  toolbar_pos;
    00058   uint8  window_snap_radius;
    00059   uint8  window_soft_limit;
    00060   bool   always_build_infrastructure;
    00061   byte   autosave;
    00062   bool   keep_all_autosave;
    00063   bool   autosave_on_exit;
    00064   uint8  date_format_in_default_names;
    00065   byte   max_num_autosaves;
    00066   bool   population_in_label;
    00067   uint8  right_mouse_btn_emulation;
    00068   uint8  scrollwheel_scrolling;
    00069   uint8  scrollwheel_multiplier;
    00070   bool   left_mouse_btn_scrolling;
    00071   bool   pause_on_newgame;
    00072   bool   enable_signal_gui;
    00073   Year   coloured_news_year;
    00074   bool   timetable_in_ticks;
    00075   bool   quick_goto;
    00076   bool   bridge_pillars;
    00077   bool   auto_euro;
    00078   byte   drag_signals_density;
    00079   Year   semaphore_build_before;
    00080   bool   autorenew;
    00081   int16  autorenew_months;
    00082   int32  autorenew_money;
    00083   byte   news_message_timeout;
    00084   bool   show_track_reservation;
    00085   uint8  default_signal_type;
    00086   uint8  cycle_signal_types;
    00087   byte   station_numtracks;
    00088   byte   station_platlength;
    00089   bool   station_dragdrop;
    00090   bool   station_show_coverage;
    00091   bool   persistent_buildingtools;
    00092   uint8  expenses_layout;
    00093
    00094   uint16 console_backlog_timeout;
    00095   uint16 console_backlog_length;
    00096 #ifdef ENABLE_NETWORK
    00097   uint16 network_chat_box_width;
    00098   uint8  network_chat_box_height;
    00099 #endif
    00100 };
    00101
    00103 struct LocaleSettings {
    00104   byte   currency;
    00105   byte   units;
    00106 };
    00107
    00109 struct NetworkSettings {
    00110 #ifdef ENABLE_NETWORK
    00111   uint16 sync_freq;
    00112   uint8  frame_freq;
    00113   uint16 max_join_time;
    00114   bool   pause_on_join;
    00115   char   server_bind_ip[NETWORK_HOSTNAME_LENGTH];
    00116   uint16 server_port;
    00117   char   server_name[NETWORK_NAME_LENGTH];
    00118   char   server_password[NETWORK_PASSWORD_LENGTH];
    00119   char   rcon_password[NETWORK_PASSWORD_LENGTH];
    00120   bool   server_advertise;
    00121   uint8  lan_internet;
    00122   char   client_name[NETWORK_CLIENT_NAME_LENGTH];
    00123   char   default_company_pass[NETWORK_PASSWORD_LENGTH];
    00124   char   connect_to_ip[NETWORK_HOSTNAME_LENGTH];
    00125   char   network_id[NETWORK_UNIQUE_ID_LENGTH];
    00126   bool   autoclean_companies;
    00127   uint8  autoclean_unprotected;
    00128   uint8  autoclean_protected;
    00129   uint8  autoclean_novehicles;
    00130   uint8  max_companies;
    00131   uint8  max_clients;
    00132   uint8  max_spectators;
    00133   Year   restart_game_year;
    00134   uint8  min_active_clients;
    00135   uint8  server_lang;
    00136   bool   reload_cfg;
    00137   char   last_host[NETWORK_HOSTNAME_LENGTH];
    00138   uint16 last_port;
    00139 #else /* ENABLE_NETWORK */
    00140 #endif
    00141 };
    00142
    00144 struct GameCreationSettings {
    00145   uint32 generation_seed;
    00146   Year   starting_year;
    00147   uint8  map_x;
    00148   uint8  map_y;
    00149   byte   land_generator;
    00150   byte   oil_refinery_limit;
    00151   byte   snow_line_height;
    00152   byte   tgen_smoothness;
    00153   byte   tree_placer;
    00154   byte   heightmap_rotation;
    00155   byte   se_flat_world_height;
    00156   byte   town_name;
    00157   byte   landscape;
    00158   byte   snow_line;
    00159   byte   water_borders;
    00160   uint16 custom_town_number;
    00161 };
    00162
    00164 struct ConstructionSettings {
    00165   bool   build_on_slopes;
    00166   bool   autoslope;
    00167   bool   longbridges;
    00168   bool   signal_side;
    00169   bool   extra_dynamite;
    00170   bool   road_stop_on_town_road;
    00171   bool   road_stop_on_competitor_road;
    00172   uint8  raw_industry_construction;
    00173   bool   freeform_edges;
    00174 };
    00175
    00177 struct AISettings {
    00178   bool   ai_in_multiplayer;
    00179   bool   ai_disable_veh_train;
    00180   bool   ai_disable_veh_roadveh;
    00181   bool   ai_disable_veh_aircraft;
    00182   bool   ai_disable_veh_ship;
    00183   uint32 ai_max_opcode_till_suspend;
    00184 };
    00185
    00187 struct OPFSettings {
    00188   uint16 pf_maxlength;
    00189   byte   pf_maxdepth;
    00190 };
    00191
    00193 struct NPFSettings {
    00199   uint32 npf_max_search_nodes;
    00200
    00201   uint32 npf_rail_firstred_penalty;
    00202   uint32 npf_rail_firstred_exit_penalty;
    00203   uint32 npf_rail_lastred_penalty;
    00204   uint32 npf_rail_station_penalty;
    00205   uint32 npf_rail_slope_penalty;
    00206   uint32 npf_rail_curve_penalty;
    00207   uint32 npf_rail_depot_reverse_penalty;
    00208   uint32 npf_rail_pbs_cross_penalty;
    00209   uint32 npf_rail_pbs_signal_back_penalty;
    00210   uint32 npf_buoy_penalty;
    00211   uint32 npf_water_curve_penalty;
    00212   uint32 npf_road_curve_penalty;
    00213   uint32 npf_crossing_penalty;
    00214   uint32 npf_road_drive_through_penalty;
    00215 };
    00216
    00218 struct YAPFSettings {
    00219   bool   disable_node_optimization;
    00220   uint32 max_search_nodes;
    00221   bool   ship_use_yapf;
    00222   bool   road_use_yapf;
    00223   bool   rail_use_yapf;
    00224   uint32 road_slope_penalty;
    00225   uint32 road_curve_penalty;
    00226   uint32 road_crossing_penalty;
    00227   uint32 road_stop_penalty;
    00228   bool   rail_firstred_twoway_eol;
    00229   uint32 rail_firstred_penalty;
    00230   uint32 rail_firstred_exit_penalty;
    00231   uint32 rail_lastred_penalty;
    00232   uint32 rail_lastred_exit_penalty;
    00233   uint32 rail_station_penalty;
    00234   uint32 rail_slope_penalty;
    00235   uint32 rail_curve45_penalty;
    00236   uint32 rail_curve90_penalty;
    00237   uint32 rail_depot_reverse_penalty;
    00238   uint32 rail_crossing_penalty;
    00239   uint32 rail_look_ahead_max_signals;
    00240   int32  rail_look_ahead_signal_p0;
    00241   int32  rail_look_ahead_signal_p1;
    00242   int32  rail_look_ahead_signal_p2;
    00243   uint32 rail_pbs_cross_penalty;
    00244   uint32 rail_pbs_station_penalty;
    00245   uint32 rail_pbs_signal_back_penalty;
    00246   uint32 rail_doubleslip_penalty;
    00247
    00248   uint32 rail_longer_platform_penalty;
    00249   uint32 rail_longer_platform_per_tile_penalty;
    00250   uint32 rail_shorter_platform_penalty;
    00251   uint32 rail_shorter_platform_per_tile_penalty;
    00252 };
    00253
    00255 struct PathfinderSettings {
    00256   uint8  pathfinder_for_trains;
    00257   uint8  pathfinder_for_roadvehs;
    00258   uint8  pathfinder_for_ships;
    00259   bool   new_pathfinding_all;
    00260
    00261   bool   roadveh_queue;
    00262   bool   forbid_90_deg;
    00263
    00264   byte   wait_oneway_signal;
    00265   byte   wait_twoway_signal;
    00266
    00267   bool   reserve_paths;
    00268   byte   wait_for_pbs_path;
    00269   byte   path_backoff_interval;
    00270
    00271   OPFSettings  opf;
    00272   NPFSettings  npf;
    00273   YAPFSettings yapf;
    00274 };
    00275
    00277 struct OrderSettings {
    00278   bool   improved_load;
    00279   bool   gradual_loading;
    00280   bool   selectgoods;
    00281   bool   gotodepot;
    00282   bool   no_servicing_if_no_breakdowns;
    00283   bool   timetabling;
    00284   bool   serviceathelipad;
    00285 };
    00286
    00288 struct VehicleSettings {
    00289   bool   mammoth_trains;
    00290   uint8  train_acceleration_model;
    00291   bool   wagon_speed_limits;
    00292   bool   disable_elrails;
    00293   UnitID max_trains;
    00294   UnitID max_roadveh;
    00295   UnitID max_aircraft;
    00296   UnitID max_ships;
    00297   bool   servint_ispercent;
    00298   uint16 servint_trains;
    00299   uint16 servint_roadveh;
    00300   uint16 servint_aircraft;
    00301   uint16 servint_ships;
    00302   uint8  plane_speed;
    00303   uint8  freight_trains;
    00304   bool   dynamic_engines;
    00305   bool   never_expire_vehicles;
    00306   byte   extend_vehicle_life;
    00307   byte   road_side;
    00308 };
    00309
    00311 struct EconomySettings {
    00312   bool   inflation;
    00313   bool   bribe;
    00314   bool   smooth_economy;
    00315   bool   allow_shares;
    00316   byte   dist_local_authority;
    00317   bool   exclusive_rights;
    00318   bool   give_money;
    00319   bool   mod_road_rebuild;
    00320   bool   multiple_industry_per_town;
    00321   bool   same_industry_close;
    00322   uint8  town_growth_rate;
    00323   uint8  larger_towns;
    00324   uint8  initial_city_size;
    00325   TownLayoutByte town_layout;
    00326   bool   allow_town_roads;
    00327   bool   station_noise_level;
    00328   uint16 town_noise_population[3];
    00329 };
    00330
    00332 struct StationSettings {
    00333   bool   modified_catchment;
    00334   bool   join_stations;
    00335   bool   nonuniform_stations;
    00336   bool   adjacent_stations;
    00337   bool   distant_join_stations;
    00338   bool   always_small_airport;
    00339   byte   station_spread;
    00340 };
    00341
    00343 struct GameSettings {
    00344   DifficultySettings   difficulty;
    00345   GameCreationSettings game_creation;
    00346   ConstructionSettings construction;
    00347   AISettings           ai;
    00348   class AIConfig      *ai_config[MAX_COMPANIES];
    00349   PathfinderSettings   pf;
    00350   OrderSettings        order;
    00351   VehicleSettings      vehicle;
    00352   EconomySettings      economy;
    00353   StationSettings      station;
    00354   LocaleSettings       locale;
    00355 };
    00356
    00358 struct ClientSettings {
    00359   GUISettings          gui;
    00360   NetworkSettings      network;
    00361 };
    00362
    00364 extern ClientSettings _settings_client;
    00365
    00367 extern GameSettings _settings_game;
    00368
    00370 extern GameSettings _settings_newgame;
    00371
    00372 #endif /* SETTINGS_TYPE_H */