# economy_type.h

Go to the documentation of this file.

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