economy_type.h

Go to the documentation of this file.
00001 /* $Id: economy_type.h 14332 2008-09-15 17:18:22Z belugas $ */
00002 
00005 #ifndef ECONOMY_TYPE_H
00006 #define ECONOMY_TYPE_H
00007 
00008 #include "core/overflowsafe_type.hpp"
00009 #include "core/enum_type.hpp"
00010 #include "cargo_type.h"
00011 
00012 typedef OverflowSafeInt64 Money;
00013 
00014 struct Economy {
00015   Money max_loan;                       
00016   Money max_loan_unround;               
00017   uint16 max_loan_unround_fract;        
00018   int16 fluct;
00019   byte interest_rate;                   
00020   byte infl_amount;                     
00021   byte infl_amount_pr;                  
00022   uint32 industry_daily_change_counter; 
00023   uint32 industry_daily_increment;      
00024 };
00025 
00026 struct Subsidy {
00027   CargoID cargo_type;
00028   byte age;
00029   /* from and to can either be TownID, StationID or IndustryID */
00030   uint16 from;
00031   uint16 to;
00032 };
00033 
00034 enum ScoreID {
00035   SCORE_BEGIN      = 0,
00036   SCORE_VEHICLES   = 0,
00037   SCORE_STATIONS   = 1,
00038   SCORE_MIN_PROFIT = 2,
00039   SCORE_MIN_INCOME = 3,
00040   SCORE_MAX_INCOME = 4,
00041   SCORE_DELIVERED  = 5,
00042   SCORE_CARGO      = 6,
00043   SCORE_MONEY      = 7,
00044   SCORE_LOAN       = 8,
00045   SCORE_TOTAL      = 9,  
00046   SCORE_END        = 10, 
00047 
00048   SCORE_MAX = 1000       
00049   /* the scores together of score_info is allowed to be more! */
00050 };
00051 DECLARE_POSTFIX_INCREMENT(ScoreID);
00052 
00053 struct ScoreInfo {
00054   byte id;    
00055   int needed; 
00056   int score;  
00057 };
00058 
00059 struct Prices {
00060   Money station_value;
00061   Money build_rail;
00062   Money build_road;
00063   Money build_signals;
00064   Money build_bridge;
00065   Money build_train_depot;
00066   Money build_road_depot;
00067   Money build_ship_depot;
00068   Money build_tunnel;
00069   Money train_station_track;
00070   Money train_station_length;
00071   Money build_airport;
00072   Money build_bus_station;
00073   Money build_truck_station;
00074   Money build_dock;
00075   Money build_railvehicle;
00076   Money build_railwagon;
00077   Money aircraft_base;
00078   Money roadveh_base;
00079   Money ship_base;
00080   Money build_trees;
00081   Money terraform;
00082   Money clear_grass;
00083   Money clear_roughland;
00084   Money clear_rocks;
00085   Money clear_fields;
00086   Money remove_trees;
00087   Money remove_rail;
00088   Money remove_signals;
00089   Money clear_bridge;
00090   Money remove_train_depot;
00091   Money remove_road_depot;
00092   Money remove_ship_depot;
00093   Money clear_tunnel;
00094   Money clear_water;
00095   Money remove_rail_station;
00096   Money remove_airport;
00097   Money remove_bus_station;
00098   Money remove_truck_station;
00099   Money remove_dock;
00100   Money remove_house;
00101   Money remove_road;
00102   Money running_rail[3];
00103   Money aircraft_running;
00104   Money roadveh_running;
00105   Money ship_running;
00106   Money build_industry;
00107 };
00108 
00109 enum {
00110   NUM_PRICES = 49,
00111 };
00112 
00113 assert_compile(NUM_PRICES * sizeof(Money) == sizeof(Prices));
00114 
00115 enum ExpensesType {
00116   EXPENSES_CONSTRUCTION =  0,
00117   EXPENSES_NEW_VEHICLES,
00118   EXPENSES_TRAIN_RUN,
00119   EXPENSES_ROADVEH_RUN,
00120   EXPENSES_AIRCRAFT_RUN,
00121   EXPENSES_SHIP_RUN,
00122   EXPENSES_PROPERTY,
00123   EXPENSES_TRAIN_INC,
00124   EXPENSES_ROADVEH_INC,
00125   EXPENSES_AIRCRAFT_INC,
00126   EXPENSES_SHIP_INC,
00127   EXPENSES_LOAN_INT,
00128   EXPENSES_OTHER,
00129   EXPENSES_END,
00130   INVALID_EXPENSES      = 0xFF,
00131 };
00132 
00133 /* The "steps" in loan size, in British Pounds! */
00134 enum {
00135   LOAN_INTERVAL        = 10000,
00136   LOAN_INTERVAL_OLD_AI = 50000,
00137 };
00138 
00139 #endif /* ECONOMY_TYPE_H */

Generated on Mon Jun 8 23:04:03 2009 for OpenTTD by  doxygen 1.5.6