summaryrefslogtreecommitdiff
path: root/industry.h
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-04-28 21:58:16 +0000
committerbelugas <belugas@openttd.org>2006-04-28 21:58:16 +0000
commit7ab8b20faf44696e276d3a15836df08bf21c7d3d (patch)
tree7a33e83753c8db062e024e30635d1349dc2275df /industry.h
parentd039d332ecbb96186249208e5692f900ef2ec07e (diff)
downloadopenttd-7ab8b20faf44696e276d3a15836df08bf21c7d3d.tar.xz
(svn r4614) CodeChange : Cleanup of industry_cmd (Step-4).
Removing the _industry_type_costs in favor of IndustrySpec.cost_multiplier; In order to let industry_gui use the GetIndustrySpec accessor, some structs had to be moved in industry.h
Diffstat (limited to 'industry.h')
-rw-r--r--industry.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/industry.h b/industry.h
index e2841ed36..bb7bb498b 100644
--- a/industry.h
+++ b/industry.h
@@ -5,6 +5,9 @@
#include "pool.h"
+typedef byte IndustryGfx;
+typedef uint8 IndustryType;
+
struct Industry {
TileIndex xy;
byte width; /* swapped order of w/h with town */
@@ -31,6 +34,37 @@ struct Industry {
uint16 index;
};
+typedef struct IndustryTileTable {
+ TileIndexDiffC ti;
+ IndustryGfx gfx;
+} IndustryTileTable;
+
+typedef struct IndustrySpec {
+ /** Tables with the 'layout' of different composition of GFXes */
+ const IndustryTileTable *const *table;
+ /** Number of elements in the table */
+ byte num_table;
+ /** Base cost multiplier*/
+ byte cost_multiplier;
+ /** Industries this industry cannot be close to */
+ IndustryType conflicting[3];
+ /** index to a procedure to check for conflicting circumstances */
+ byte check_proc;
+
+ CargoID produced_cargo[2];
+ byte production_rate[2];
+ /** The minimum amount of cargo transported to the stations; if the
+ * waiting cargo is less than this number, no cargo is moved to it*/
+ byte minimal_cargo;
+ CargoID accepts_cargo[3];
+
+ StringID closure_text;
+ StringID production_up_text;
+ StringID production_down_text;
+} IndustrySpec;
+
+const IndustrySpec *GetIndustrySpec(IndustryType thistype);
+
extern MemoryPool _industry_pool;
/**
@@ -65,7 +99,6 @@ VARDEF int _total_industries; // For the AI: the amount of industries active
VARDEF uint16 *_industry_sort;
VARDEF bool _industry_sort_dirty;
-typedef uint8 IndustryType;
void DeleteIndustry(Industry *is);