From 7ab8b20faf44696e276d3a15836df08bf21c7d3d Mon Sep 17 00:00:00 2001 From: belugas Date: Fri, 28 Apr 2006 21:58:16 +0000 Subject: (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 --- industry.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'industry.h') 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); -- cgit v1.2.3-54-g00ecf