author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 820 | 924f78b43e9e |
child 1977 | 37bbebf94434 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef ECONOMY_H |
2 |
#define ECONOMY_H |
|
3 |
||
4 |
typedef struct { |
|
5 |
// Maximum possible loan |
|
6 |
int32 max_loan; |
|
7 |
int32 max_loan_unround; |
|
8 |
// Economy fluctuation status |
|
9 |
int fluct; |
|
10 |
// Interest |
|
11 |
byte interest_rate; |
|
12 |
byte infl_amount; |
|
13 |
byte infl_amount_pr; |
|
14 |
} Economy; |
|
15 |
||
16 |
VARDEF Economy _economy; |
|
17 |
||
18 |
typedef struct Subsidy { |
|
19 |
byte cargo_type; |
|
20 |
byte age; |
|
820
924f78b43e9e
(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
truelight
parents:
240
diff
changeset
|
21 |
uint16 from; |
924f78b43e9e
(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
truelight
parents:
240
diff
changeset
|
22 |
uint16 to; |
0 | 23 |
} Subsidy; |
24 |
||
25 |
||
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
26 |
enum { |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
27 |
SCORE_VEHICLES = 0, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
28 |
SCORE_STATIONS = 1, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
29 |
SCORE_MIN_PROFIT = 2, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
30 |
SCORE_MIN_INCOME = 3, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
31 |
SCORE_MAX_INCOME = 4, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
32 |
SCORE_DELIVERED = 5, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
33 |
SCORE_CARGO = 6, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
34 |
SCORE_MONEY = 7, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
35 |
SCORE_LOAN = 8, |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
36 |
SCORE_TOTAL = 9, // This must always be the last entry |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
37 |
|
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
38 |
NUM_SCORE = 10, // How many scores are there.. |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
39 |
|
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
40 |
SCORE_MAX = 1000, // The max score that can be in the performance history |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
41 |
// the scores together of score_info is allowed to be more! |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
42 |
}; |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
43 |
|
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
44 |
typedef struct ScoreInfo { |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
45 |
byte id; // Unique ID of the score |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
46 |
int needed; // How much you need to get the perfect score |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
47 |
int score; // How much score it will give |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
48 |
} ScoreInfo; |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
49 |
|
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
50 |
static const ScoreInfo score_info[] = { |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
51 |
{SCORE_VEHICLES, 120, 100}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
52 |
{SCORE_STATIONS, 80, 100}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
53 |
{SCORE_MIN_PROFIT, 10000, 100}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
54 |
{SCORE_MIN_INCOME, 50000, 50}, |
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
55 |
{SCORE_MAX_INCOME, 100000, 100}, |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
56 |
{SCORE_DELIVERED, 40000, 400}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
57 |
{SCORE_CARGO, 8, 50}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
58 |
{SCORE_MONEY, 10000000, 50}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
59 |
{SCORE_LOAN, 250000, 50}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
147
diff
changeset
|
60 |
{SCORE_TOTAL, 0, 0} |
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
61 |
}; |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
62 |
|
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
63 |
int _score_part[MAX_PLAYERS][NUM_SCORE]; |
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
64 |
|
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
116
diff
changeset
|
65 |
int UpdateCompanyRatingAndValue(Player *p, bool update); |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
116
diff
changeset
|
66 |
void UpdatePlayerHouse(Player *p, uint score); |
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
67 |
|
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
0
diff
changeset
|
68 |
|
0 | 69 |
VARDEF Subsidy _subsidies[MAX_PLAYERS]; |
70 |
Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode); |
|
820
924f78b43e9e
(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
truelight
parents:
240
diff
changeset
|
71 |
void DeleteSubsidyWithIndustry(uint16 index); |
924f78b43e9e
(svn r1291) -Codechange: prepared subsidies and towns to become an uint16 (happens
truelight
parents:
240
diff
changeset
|
72 |
void DeleteSubsidyWithStation(uint16 index); |
240 | 73 |
void RemoteSubsidyAdd(Subsidy *s_new); |
0 | 74 |
|
75 |
int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type); |
|
76 |
uint MoveGoodsToStation(uint tile, int w, int h, int type, uint amount); |
|
77 |
||
78 |
#endif /* ECONOMY_H */ |