author | truebrain |
Sun, 15 Jun 2008 22:37:35 +0000 | |
branch | noai |
changeset 10972 | 986675d19245 |
parent 10829 | 8a0ec0f0f928 |
child 11126 | 72d4c9314c72 |
permissions | -rw-r--r-- |
9723 | 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 |
|
10829 | 21 |
byte infl_amount_pr; ///< inflation rate for payment rates |
9723 | 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, |
|
9732 | 115 |
EXPENSES_NEW_VEHICLES, |
116 |
EXPENSES_TRAIN_RUN, |
|
117 |
EXPENSES_ROADVEH_RUN, |
|
118 |
EXPENSES_AIRCRAFT_RUN, |
|
119 |
EXPENSES_SHIP_RUN, |
|
120 |
EXPENSES_PROPERTY, |
|
121 |
EXPENSES_TRAIN_INC, |
|
122 |
EXPENSES_ROADVEH_INC, |
|
123 |
EXPENSES_AIRCRAFT_INC, |
|
124 |
EXPENSES_SHIP_INC, |
|
125 |
EXPENSES_LOAN_INT, |
|
126 |
EXPENSES_OTHER, |
|
127 |
EXPENSES_END, |
|
9723 | 128 |
INVALID_EXPENSES = 0xFF, |
129 |
}; |
|
130 |
||
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
131 |
/* The "steps" in loan size, in British Pounds! */ |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
132 |
enum { |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
133 |
LOAN_INTERVAL = 10000, |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
134 |
LOAN_INTERVAL_OLD_AI = 50000, |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
135 |
}; |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
136 |
|
9723 | 137 |
#endif /* ECONOMY_TYPE_H */ |