annotate src/industrytype.h @ 19968:0dba7f49118c draft

(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
author planetmaker <planetmaker@openttd.org>
date Tue, 08 Jan 2013 22:46:42 +0000
parents f39835c7ead4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
18855
a0d7e20ebafe (svn r23704) -Doc: Doxygen comment fixes and additions.
alberth <alberth@openttd.org>
parents: 18747
diff changeset
10 /** @file industrytype.h %Industry type specs. */
12825
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 "map_type.h"
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
16 #include "slope_type.h"
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
17 #include "industry_type.h"
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
18 #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
19 #include "cargo_type.h"
15935
a4fa352275f4 (svn r20623) -Codechange: unify the storing of animation related information
rubidium <rubidium@openttd.org>
parents: 15731
diff changeset
20 #include "newgrf_animation_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
21 #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
22
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
23 enum IndustryCleanupType {
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
24 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
25 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
26 };
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
27
14565
14cb34302cfe (svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents: 14492
diff changeset
28 /** 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
29 enum IndustryLifeType {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
30 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
31 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
32 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
33 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
34 };
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
35
15620
f8e9a3f0c140 (svn r20283) -Codechange: Unify start of doygen comments.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
36 /**
f8e9a3f0c140 (svn r20283) -Codechange: Unify start of doygen comments.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
37 * 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
38 * @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
39 */
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
40 enum CheckProc {
14565
14cb34302cfe (svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents: 14492
diff changeset
41 CHECK_NOTHING, ///< Always succeeds.
14cb34302cfe (svn r19136) -Doc: Added Doxygen comments for industry checking procedures.
alberth <alberth@openttd.org>
parents: 14492
diff changeset
42 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
43 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
44 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
45 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
46 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
47 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
48 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
49 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
50 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
51 };
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 /** 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
54 enum IndustryConstructionType {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
55 ICT_UNKNOWN, ///< in previous game version or without newindustries activated
16541
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
56 ICT_NORMAL_GAMEPLAY, ///< either by user or random creation process
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
57 ICT_MAP_GENERATION, ///< during random map creation
18747
9e25a152f92d (svn r23595) -Codechange: add comma after last enum to get a more uniform coding style
rubidium <rubidium@openttd.org>
parents: 18746
diff changeset
58 ICT_SCENARIO_EDITOR, ///< while editing a scenario
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
59 };
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
60
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
61 /** 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
62 enum IndustryBehaviour {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
63 INDUSTRYBEH_NONE = 0,
16541
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
64 INDUSTRYBEH_PLANT_FIELDS = 1 << 0, ///< periodically plants fields around itself (temp and arctic farms)
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
65 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
66 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
67 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
68 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
69 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
70 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
71 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
72 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
73 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
74 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
75 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
76 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
77 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
78 /* 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
79 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
80 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
81 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
82 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
83 };
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
84 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
85
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
86 /** 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
87 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
88 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
89 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
90 };
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
91 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
92
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
93 struct IndustryTileTable {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
94 TileIndexDiffC ti;
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
95 IndustryGfx gfx;
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
96 };
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 * 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
100 */
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
101 struct IndustrySpec {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
102 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
103 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
104 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
105 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
106 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
107 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
108 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
109 CargoID produced_cargo[2];
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
110 byte production_rate[2];
18746
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
111 /**
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
112 * minimum amount of cargo transported to the stations.
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
113 * If the waiting cargo is less than this number, no cargo is moved to it.
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
114 */
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
115 byte minimal_cargo;
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
116 CargoID accepts_cargo[3]; ///< 3 accepted cargoes.
18678
5604c42fa1ce (svn r23526) -Codechange: unify cargos vs cargoes
rubidium <rubidium@openttd.org>
parents: 17108
diff changeset
117 uint16 input_cargo_multiplier[3][2]; ///< Input cargo multipliers (multiply amount of incoming cargo for the produced cargoes)
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
118 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
119 byte climate_availability; ///< Bitmask, giving landscape enums as bit position
18678
5604c42fa1ce (svn r23526) -Codechange: unify cargos vs cargoes
rubidium <rubidium@openttd.org>
parents: 17108
diff changeset
120 IndustryBehaviour behaviour; ///< How this industry will behave, and how others entities can use it
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
121 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
122 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
123 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
124 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
125 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
126 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
127 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
128 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
129 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
130 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
131 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
132 /* Newgrf data */
13036
8e2a0e8fa275 (svn r17534) -Codechange: unify the naming of callback masks/flags
rubidium <rubidium@openttd.org>
parents: 12825
diff changeset
133 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
134 uint8 cleanup_flag; ///< flags indicating which data should be freed upon cleaning up
16541
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
135 bool enabled; ///< entity still available (by default true).newgrf can disable it, though
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
136 GRFFileProps grf_prop; ///< properties related to the grf file
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
137
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
138 bool IsRawIndustry() const;
19604
f39835c7ead4 (svn r24513) -Add: [Script] ScriptIndustryType::IsProcessingIndustry.
frosch <frosch@openttd.org>
parents: 18886
diff changeset
139 bool IsProcessingIndustry() const;
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
140 Money GetConstructionCost() const;
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
141 Money GetRemovalCost() const;
16154
29354dbd86d4 (svn r20850) -Codechange: Add IndustrySpec::UsesSmoothEconomy() to deduplicate code.
frosch <frosch@openttd.org>
parents: 15935
diff changeset
142 bool UsesSmoothEconomy() const;
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
143 };
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
144
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
145 /**
19968
0dba7f49118c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
planetmaker <planetmaker@openttd.org>
parents: 19604
diff changeset
146 * Defines the data structure of each individual tile of an industry.
12825
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 struct IndustryTileSpec {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
149 CargoID accepts_cargo[3]; ///< Cargo accepted by this tile
16541
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
150 uint8 acceptance[3]; ///< Level of acceptance per cargo type
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
151 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
152 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
153 byte anim_next; ///< Next frame in an animation
18746
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
154 /**
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
155 * When true, the tile has to be drawn using the animation
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
156 * state instead of the construction state
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
157 */
6f51fce90722 (svn r23594) -Codechange: follow coding style with multi line comments
rubidium <rubidium@openttd.org>
parents: 18678
diff changeset
158 bool anim_state;
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
159 /* Newgrf data */
13036
8e2a0e8fa275 (svn r17534) -Codechange: unify the naming of callback masks/flags
rubidium <rubidium@openttd.org>
parents: 12825
diff changeset
160 uint8 callback_mask; ///< Bitmask of industry tile callbacks that have to be called
15935
a4fa352275f4 (svn r20623) -Codechange: unify the storing of animation related information
rubidium <rubidium@openttd.org>
parents: 15731
diff changeset
161 AnimationInfo animation; ///< Information about the animation (is it looping, how many loops etc)
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
162 IndustryTileSpecialFlags special_flags; ///< Bitmask of extra flags used by the tile
16541
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
163 bool enabled; ///< entity still available (by default true).newgrf can disable it, though
9da0e640ebb8 (svn r21267) -Doc: Typo fixes.
alberth <alberth@openttd.org>
parents: 16154
diff changeset
164 GRFFileProps grf_prop; ///< properties related to the grf file
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
165 };
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
166
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
167 /* industry_cmd.cpp*/
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
168 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
169 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
170 void ResetIndustries();
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
171
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
172 /* writable arrays of specs */
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
173 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
174 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
175
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
176 /* 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
177 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
178 /* 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
179 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
180
14021
53eee9df97d5 (svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents: 13757
diff changeset
181 /**
53eee9df97d5 (svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents: 13757
diff changeset
182 * Do industry gfx ID translation for NewGRFs.
53eee9df97d5 (svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents: 13757
diff changeset
183 * @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
184 * @return the gfx to actually work with.
53eee9df97d5 (svn r18563) -Document: some industry related functions
rubidium <rubidium@openttd.org>
parents: 13757
diff changeset
185 */
12825
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
186 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
187 {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
188 /* 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
189 * 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
190 * 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
191 * 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
192 * 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
193 if (gfx != 0xFF) {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
194 assert(gfx < INVALID_INDUSTRYTILE);
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
195 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
196 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
197 } else {
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
198 return gfx;
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
199 }
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
200 }
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
201
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
202 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
203
1bd6b38694ac (svn r17315) -Codechange: move code related to industry types to separate file
smatz <smatz@openttd.org>
parents:
diff changeset
204 #endif /* INDUSTRYTYPE_H */