src/economy_type.h
branchNewGRF_ports
changeset 6872 1c4a4a609f85
child 6878 7d1ff2f621c7
equal deleted inserted replaced
6871:5a9dc001e1ad 6872:1c4a4a609f85
       
     1 /* $Id$ */
       
     2 
       
     3 /** @file economy_type.h Types related to the economy. */
       
     4 
       
     5 #ifndef ECONOMY_TYPE_H
       
     6 #define ECONOMY_TYPE_H
       
     7 
       
     8 #include "core/overflowsafe_type.hpp"
       
     9 #include "core/enum_type.hpp"
       
    10 #include "cargo_type.h"
       
    11 
       
    12 typedef OverflowSafeInt64 Money;
       
    13 
       
    14 struct Economy {
       
    15 	Money max_loan;         ///< Maximum possible loan
       
    16 	Money max_loan_unround; ///< Economy fluctuation status
       
    17 	uint16 max_loan_unround_fract; ///< Fraction of the unrounded max loan
       
    18 	int fluct;
       
    19 	byte interest_rate;     ///< Interest
       
    20 	byte infl_amount;       ///< inflation amount
       
    21 	byte infl_amount_pr;    ///< "floating" portion of inflation
       
    22 };
       
    23 
       
    24 struct Subsidy {
       
    25 	CargoID cargo_type;
       
    26 	byte age;
       
    27 	/* from and to can either be TownID, StationID or IndustryID */
       
    28 	uint16 from;
       
    29 	uint16 to;
       
    30 };
       
    31 
       
    32 enum ScoreID {
       
    33 	SCORE_BEGIN      = 0,
       
    34 	SCORE_VEHICLES   = 0,
       
    35 	SCORE_STATIONS   = 1,
       
    36 	SCORE_MIN_PROFIT = 2,
       
    37 	SCORE_MIN_INCOME = 3,
       
    38 	SCORE_MAX_INCOME = 4,
       
    39 	SCORE_DELIVERED  = 5,
       
    40 	SCORE_CARGO      = 6,
       
    41 	SCORE_MONEY      = 7,
       
    42 	SCORE_LOAN       = 8,
       
    43 	SCORE_TOTAL      = 9,  ///< This must always be the last entry
       
    44 	SCORE_END        = 10, ///< How many scores are there..
       
    45 
       
    46 	SCORE_MAX = 1000       ///< The max score that can be in the performance history
       
    47 	/* the scores together of score_info is allowed to be more! */
       
    48 };
       
    49 DECLARE_POSTFIX_INCREMENT(ScoreID);
       
    50 
       
    51 struct ScoreInfo {
       
    52 	byte id;    ///< Unique ID of the score
       
    53 	int needed; ///< How much you need to get the perfect score
       
    54 	int score;  ///< How much score it will give
       
    55 };
       
    56 
       
    57 struct Prices {
       
    58 	Money station_value;
       
    59 	Money build_rail;
       
    60 	Money build_road;
       
    61 	Money build_signals;
       
    62 	Money build_bridge;
       
    63 	Money build_train_depot;
       
    64 	Money build_road_depot;
       
    65 	Money build_ship_depot;
       
    66 	Money build_tunnel;
       
    67 	Money train_station_track;
       
    68 	Money train_station_length;
       
    69 	Money build_airport;
       
    70 	Money build_bus_station;
       
    71 	Money build_truck_station;
       
    72 	Money build_dock;
       
    73 	Money build_railvehicle;
       
    74 	Money build_railwagon;
       
    75 	Money aircraft_base;
       
    76 	Money roadveh_base;
       
    77 	Money ship_base;
       
    78 	Money build_trees;
       
    79 	Money terraform;
       
    80 	Money clear_grass;
       
    81 	Money clear_roughland;
       
    82 	Money clear_rocks;
       
    83 	Money clear_fields;
       
    84 	Money remove_trees;
       
    85 	Money remove_rail;
       
    86 	Money remove_signals;
       
    87 	Money clear_bridge;
       
    88 	Money remove_train_depot;
       
    89 	Money remove_road_depot;
       
    90 	Money remove_ship_depot;
       
    91 	Money clear_tunnel;
       
    92 	Money clear_water;
       
    93 	Money remove_rail_station;
       
    94 	Money remove_airport;
       
    95 	Money remove_bus_station;
       
    96 	Money remove_truck_station;
       
    97 	Money remove_dock;
       
    98 	Money remove_house;
       
    99 	Money remove_road;
       
   100 	Money running_rail[3];
       
   101 	Money aircraft_running;
       
   102 	Money roadveh_running;
       
   103 	Money ship_running;
       
   104 	Money build_industry;
       
   105 };
       
   106 
       
   107 enum {
       
   108 	NUM_PRICES = 49,
       
   109 };
       
   110 
       
   111 assert_compile(NUM_PRICES * sizeof(Money) == sizeof(Prices));
       
   112 
       
   113 enum ExpensesType {
       
   114 	EXPENSES_CONSTRUCTION =  0,
       
   115 	EXPENSES_NEW_VEHICLES =  1,
       
   116 	EXPENSES_TRAIN_RUN    =  2,
       
   117 	EXPENSES_ROADVEH_RUN  =  3,
       
   118 	EXPENSES_AIRCRAFT_RUN =  4,
       
   119 	EXPENSES_SHIP_RUN     =  5,
       
   120 	EXPENSES_PROPERTY     =  6,
       
   121 	EXPENSES_TRAIN_INC    =  7,
       
   122 	EXPENSES_ROADVEH_INC  =  8,
       
   123 	EXPENSES_AIRCRAFT_INC =  9,
       
   124 	EXPENSES_SHIP_INC     = 10,
       
   125 	EXPENSES_LOAN_INT     = 11,
       
   126 	EXPENSES_OTHER        = 12,
       
   127 	INVALID_EXPENSES      = 0xFF,
       
   128 };
       
   129 
       
   130 /* The "steps" in loan size, in British Pounds! */
       
   131 enum {
       
   132 	LOAN_INTERVAL        = 10000,
       
   133 	LOAN_INTERVAL_OLD_AI = 50000,
       
   134 };
       
   135 
       
   136 #endif /* ECONOMY_TYPE_H */