Mercurial > hg > openttd
annotate src/industrytype.h @ 15731:c5f579b016bc draft
(svn r20398) -Codechange: move some variables of GRFFileProps into (the new) GRFFilePropsBase
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 07 Aug 2010 20:51:07 +0000 |
parents | f8e9a3f0c140 |
children | a4fa352275f4 |
rev | line source |
---|---|
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
2 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
3 /* |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
4 * This file is part of OpenTTD. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
8 */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
9 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
10 /** @file industrytype.h Industry type specs. */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
11 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
12 #ifndef INDUSTRYTYPE_H |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
13 #define INDUSTRYTYPE_H |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
14 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
15 #include "economy_type.h" |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
16 #include "map_type.h" |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
17 #include "slope_type.h" |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
18 #include "industry_type.h" |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
19 #include "landscape_type.h" |
14258
a899d4e5ee1a
(svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header
rubidium <rubidium@openttd.org>
parents:
14021
diff
changeset
|
20 #include "strings_type.h" |
a899d4e5ee1a
(svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header
rubidium <rubidium@openttd.org>
parents:
14021
diff
changeset
|
21 #include "cargo_type.h" |
14616
3b8f660a561d
(svn r19193) -Codechange: increase the maximum number of airport tiles to 256 and introduce AirportTileOverrideManager
yexo <yexo@openttd.org>
parents:
14565
diff
changeset
|
22 #include "newgrf_commons.h" |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
23 |
15183
43a5d37b45c4
(svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents:
14923
diff
changeset
|
24 enum IndustryCleanupType { |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
25 CLEAN_RANDOMSOUNDS, ///< Free the dynamically allocated sounds table |
14492
aaf7de90045e
(svn r19063) -Codechange: type in constant name (andythenorth)
yexo <yexo@openttd.org>
parents:
14484
diff
changeset
|
26 CLEAN_TILELAYOUT, ///< Free the dynamically allocated tile layout structure |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
27 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
28 |
14565
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
29 /** Available types of industry lifetimes. */ |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
30 enum IndustryLifeType { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
31 INDUSTRYLIFE_BLACK_HOLE = 0, ///< Like power plants and banks |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
32 INDUSTRYLIFE_EXTRACTIVE = 1 << 0, ///< Like mines |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
33 INDUSTRYLIFE_ORGANIC = 1 << 1, ///< Like forests |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
34 INDUSTRYLIFE_PROCESSING = 1 << 2, ///< Like factories |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
35 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
36 |
15620
f8e9a3f0c140
(svn r20283) -Codechange: Unify start of doygen comments.
frosch <frosch@openttd.org>
parents:
15183
diff
changeset
|
37 /** |
f8e9a3f0c140
(svn r20283) -Codechange: Unify start of doygen comments.
frosch <frosch@openttd.org>
parents:
15183
diff
changeset
|
38 * Available procedures to check whether an industry may build at a given location. |
14565
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
39 * @see CheckNewIndustryProc, _check_new_industry_procs[] |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
40 */ |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
41 enum CheckProc { |
14565
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
42 CHECK_NOTHING, ///< Always succeeds. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
43 CHECK_FOREST, ///< %Industry should be build above snow-line in arctic climate. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
44 CHECK_REFINERY, ///< %Industry should be positioned near edge of the map. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
45 CHECK_FARM, ///< %Industry should be below snow-line in arctic. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
46 CHECK_PLANTATION, ///< %Industry should NOT be in the desert. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
47 CHECK_WATER, ///< %Industry should be in the desert. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
48 CHECK_LUMBERMILL, ///< %Industry should be in the rain forest. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
49 CHECK_BUBBLEGEN, ///< %Industry should be in low land. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
50 CHECK_OIL_RIG, ///< Industries at sea should be positioned near edge of the map. |
14cb34302cfe
(svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents:
14492
diff
changeset
|
51 CHECK_END, ///< End marker of the industry check procedures. |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
52 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
53 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
54 /** How was the industry created */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
55 enum IndustryConstructionType { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
56 ICT_UNKNOWN, ///< in previous game version or without newindustries activated |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
57 ICT_NORMAL_GAMEPLAY, ///< either by user or random creation proccess |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
58 ICT_MAP_GENERATION, ///< during random map creation |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
59 ICT_SCENARIO_EDITOR ///< while scenarion edition |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
60 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
61 |
14484
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
62 /** Various industry behaviours mostly to represent original TTD specialities */ |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
63 enum IndustryBehaviour { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
64 INDUSTRYBEH_NONE = 0, |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
65 INDUSTRYBEH_PLANT_FIELDS = 1 << 0, ///< periodically plants fileds around itself (temp and artic farms) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
66 INDUSTRYBEH_CUT_TREES = 1 << 1, ///< cuts trees and produce first output cargo from them (lumber mill) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
67 INDUSTRYBEH_BUILT_ONWATER = 1 << 2, ///< is built on water (oil rig) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
68 INDUSTRYBEH_TOWN1200_MORE = 1 << 3, ///< can only be built in towns larger than 1200 inhabitants (temperate bank) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
69 INDUSTRYBEH_ONLY_INTOWN = 1 << 4, ///< can only be built in towns (arctic/tropic banks, water tower) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
70 INDUSTRYBEH_ONLY_NEARTOWN = 1 << 5, ///< is always built near towns (toy shop) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
71 INDUSTRYBEH_PLANT_ON_BUILT = 1 << 6, ///< Fields are planted around when built (all farms) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
72 INDUSTRYBEH_DONT_INCR_PROD = 1 << 7, ///< do not increase production (oil wells) in the temperate climate |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
73 INDUSTRYBEH_BEFORE_1950 = 1 << 8, ///< can only be built before 1950 (oil wells) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
74 INDUSTRYBEH_AFTER_1960 = 1 << 9, ///< can only be built after 1960 (oil rigs) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
75 INDUSTRYBEH_AI_AIRSHIP_ROUTES = 1 << 10, ///< ai will attempt to establish air/ship routes to this industry (oil rig) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
76 INDUSTRYBEH_AIRPLANE_ATTACKS = 1 << 11, ///< can be exploded by a military airplane (oil refinery) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
77 INDUSTRYBEH_CHOPPER_ATTACKS = 1 << 12, ///< can be exploded by a military helicopter (factory) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
78 INDUSTRYBEH_CAN_SUBSIDENCE = 1 << 13, ///< can cause a subsidence (coal mine, shaft that collapses) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
79 /* The following flags are only used for newindustries and do no represent any normal behaviour */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
80 INDUSTRYBEH_PROD_MULTI_HNDLING = 1 << 14, ///< Automatic production multiplier handling |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
81 INDUSTRYBEH_PRODCALLBACK_RANDOM = 1 << 15, ///< Production callback needs random bits in var 10 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
82 INDUSTRYBEH_NOBUILT_MAPCREATION = 1 << 16, ///< Do not force one instance of this type to appear on map generation |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
83 INDUSTRYBEH_CANCLOSE_LASTINSTANCE = 1 << 17, ///< Allow closing down the last instance of this type |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
84 }; |
14910
bd99e52e5aa2
(svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET
smatz <smatz@openttd.org>
parents:
14885
diff
changeset
|
85 DECLARE_ENUM_AS_BIT_SET(IndustryBehaviour) |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
86 |
14484
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
87 /** Flags for miscellaneous industry tile specialities */ |
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
88 enum IndustryTileSpecialFlags { |
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
89 INDTILE_SPECIAL_NONE = 0, |
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
90 INDTILE_SPECIAL_NEXTFRAME_RANDOMBITS = 1 << 0, ///< Callback 0x26 needs random bits |
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
91 }; |
14910
bd99e52e5aa2
(svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET
smatz <smatz@openttd.org>
parents:
14885
diff
changeset
|
92 DECLARE_ENUM_AS_BIT_SET(IndustryTileSpecialFlags) |
14484
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
93 |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
94 struct IndustryTileTable { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
95 TileIndexDiffC ti; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
96 IndustryGfx gfx; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
97 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
98 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
99 /** |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
100 * Defines the data structure for constructing industry. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
101 */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
102 struct IndustrySpec { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
103 const IndustryTileTable * const *table;///< List of the tiles composing the industry |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
104 byte num_table; ///< Number of elements in the table |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
105 uint8 cost_multiplier; ///< Base construction cost multiplier. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
106 uint32 removal_cost_multiplier; ///< Base removal cost multiplier. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
107 uint32 prospecting_chance; ///< Chance prospecting succeeds |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
108 IndustryType conflicting[3]; ///< Industries this industry cannot be close to |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
109 byte check_proc; ///< Index to a procedure to check for conflicting circumstances |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
110 CargoID produced_cargo[2]; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
111 byte production_rate[2]; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
112 byte minimal_cargo; ///< minimum amount of cargo transported to the stations |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
113 ///< If the waiting cargo is less than this number, no cargo is moved to it |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
114 CargoID accepts_cargo[3]; ///< 3 accepted cargos |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
115 uint16 input_cargo_multiplier[3][2]; ///< Input cargo multipliers (multiply amount of incoming cargo for the produced cargos) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
116 IndustryLifeType life_type; ///< This is also known as Industry production flag, in newgrf specs |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
117 byte climate_availability; ///< Bitmask, giving landscape enums as bit position |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
118 IndustryBehaviour behaviour; ///< How this industry will behave, and how others entities can use it |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
119 byte map_colour; ///< colour used for the small map |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
120 StringID name; ///< Displayed name of the industry |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
121 StringID new_industry_text; ///< Message appearing when the industry is built |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
122 StringID closure_text; ///< Message appearing when the industry closes |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
123 StringID production_up_text; ///< Message appearing when the industry's production is increasing |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
124 StringID production_down_text; ///< Message appearing when the industry's production is decreasing |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
125 StringID station_name; ///< Default name for nearby station |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
126 byte appear_ingame[NUM_LANDSCAPE]; ///< Probability of appearance in game |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
127 byte appear_creation[NUM_LANDSCAPE]; ///< Probability of appearance during map creation |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
128 uint8 number_of_sounds; ///< Number of sounds available in the sounds array |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
129 const uint8 *random_sounds; ///< array of random sounds. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
130 /* Newgrf data */ |
13036
8e2a0e8fa275
(svn r17534) -Codechange: unify the naming of callback masks/flags
rubidium <rubidium@openttd.org>
parents:
12825
diff
changeset
|
131 uint16 callback_mask; ///< Bitmask of industry callbacks that have to be called |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
132 uint8 cleanup_flag; ///< flags indicating which data should be freed upon cleaning up |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
133 bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though |
15731
c5f579b016bc
(svn r20398) -Codechange: move some variables of GRFFileProps into (the new) GRFFilePropsBase
rubidium <rubidium@openttd.org>
parents:
15620
diff
changeset
|
134 GRFFileProps grf_prop; ///< properties related the the grf file |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
135 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
136 /** |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
137 * Is an industry with the spec a raw industry? |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
138 * @return true if it should be handled as a raw industry |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
139 */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
140 bool IsRawIndustry() const; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
141 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
142 /** |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
143 * Get the cost for constructing this industry |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
144 * @return the cost (inflation corrected etc) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
145 */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
146 Money GetConstructionCost() const; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
147 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
148 /** |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
149 * Get the cost for removing this industry |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
150 * Take note that the cost will always be zero for non-grf industries. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
151 * Only if the grf author did specified a cost will it be applicable. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
152 * @return the cost (inflation corrected etc) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
153 */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
154 Money GetRemovalCost() const; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
155 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
156 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
157 /** |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
158 * Defines the data structure of each indivudual tile of an industry. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
159 */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
160 struct IndustryTileSpec { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
161 CargoID accepts_cargo[3]; ///< Cargo accepted by this tile |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
162 uint8 acceptance[3]; ///< Level of aceptance per cargo type |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
163 Slope slopes_refused; ///< slope pattern on which this tile cannot be built |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
164 byte anim_production; ///< Animation frame to start when goods are produced |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
165 byte anim_next; ///< Next frame in an animation |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
166 bool anim_state; ///< When true, the tile has to be drawn using the animation |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
167 ///< state instead of the construction state |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
168 /* Newgrf data */ |
13036
8e2a0e8fa275
(svn r17534) -Codechange: unify the naming of callback masks/flags
rubidium <rubidium@openttd.org>
parents:
12825
diff
changeset
|
169 uint8 callback_mask; ///< Bitmask of industry tile callbacks that have to be called |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
170 uint16 animation_info; ///< Information about the animation (is it looping, how many loops etc) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
171 uint8 animation_speed; ///< The speed of the animation |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
172 uint8 animation_triggers; ///< When to start the animation |
14484
24501a41ea9a
(svn r19053) -Codechange: Add an enum for the special flags of industry tiles. (based on andythenorth' work)
frosch <frosch@openttd.org>
parents:
14258
diff
changeset
|
173 IndustryTileSpecialFlags special_flags; ///< Bitmask of extra flags used by the tile |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
174 bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though |
15731
c5f579b016bc
(svn r20398) -Codechange: move some variables of GRFFileProps into (the new) GRFFilePropsBase
rubidium <rubidium@openttd.org>
parents:
15620
diff
changeset
|
175 GRFFileProps grf_prop; ///< properties related the the grf file |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
176 }; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
177 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
178 /* industry_cmd.cpp*/ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
179 const IndustrySpec *GetIndustrySpec(IndustryType thistype); ///< Array of industries data |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
180 const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx); ///< Array of industry tiles data |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
181 void ResetIndustries(); |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
182 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
183 /* writable arrays of specs */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
184 extern IndustrySpec _industry_specs[NUM_INDUSTRYTYPES]; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
185 extern IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES]; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
186 |
14923
c9d12cddf23f
(svn r19521) -Codechange: Use a IndustryType array to sort industries by name instead of a LegendAndColour array.
terkhen <terkhen@openttd.org>
parents:
14910
diff
changeset
|
187 /* industry_gui.cpp */ |
c9d12cddf23f
(svn r19521) -Codechange: Use a IndustryType array to sort industries by name instead of a LegendAndColour array.
terkhen <terkhen@openttd.org>
parents:
14910
diff
changeset
|
188 void SortIndustryTypes(); |
c9d12cddf23f
(svn r19521) -Codechange: Use a IndustryType array to sort industries by name instead of a LegendAndColour array.
terkhen <terkhen@openttd.org>
parents:
14910
diff
changeset
|
189 /* Industry types sorted alphabetically by name. */ |
c9d12cddf23f
(svn r19521) -Codechange: Use a IndustryType array to sort industries by name instead of a LegendAndColour array.
terkhen <terkhen@openttd.org>
parents:
14910
diff
changeset
|
190 extern IndustryType _sorted_industry_types[NUM_INDUSTRYTYPES]; |
c9d12cddf23f
(svn r19521) -Codechange: Use a IndustryType array to sort industries by name instead of a LegendAndColour array.
terkhen <terkhen@openttd.org>
parents:
14910
diff
changeset
|
191 |
14021
53eee9df97d5
(svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents:
13757
diff
changeset
|
192 /** |
53eee9df97d5
(svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents:
13757
diff
changeset
|
193 * Do industry gfx ID translation for NewGRFs. |
53eee9df97d5
(svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents:
13757
diff
changeset
|
194 * @param gfx the type to get the override for. |
53eee9df97d5
(svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents:
13757
diff
changeset
|
195 * @return the gfx to actually work with. |
53eee9df97d5
(svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents:
13757
diff
changeset
|
196 */ |
12825
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
197 static inline IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx) |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
198 { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
199 /* the 0xFF should be GFX_WATERTILE_SPECIALCHECK but for reasons of include mess, |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
200 * we'll simplify the writing. |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
201 * Basically, the first test is required since the GFX_WATERTILE_SPECIALCHECK value |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
202 * will never be assigned as a tile index and is only required in order to do some |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
203 * tests while building the industry (as in WATER REQUIRED */ |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
204 if (gfx != 0xFF) { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
205 assert(gfx < INVALID_INDUSTRYTILE); |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
206 const IndustryTileSpec *it = &_industry_tile_specs[gfx]; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
207 return it->grf_prop.override == INVALID_INDUSTRYTILE ? gfx : it->grf_prop.override; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
208 } else { |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
209 return gfx; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
210 } |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
211 } |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
212 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
213 static const uint8 IT_INVALID = 255; |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
214 |
1bd6b38694ac
(svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff
changeset
|
215 #endif /* INDUSTRYTYPE_H */ |