diff options
author | belugas <belugas@openttd.org> | 2006-04-28 21:58:16 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2006-04-28 21:58:16 +0000 |
commit | 7ab8b20faf44696e276d3a15836df08bf21c7d3d (patch) | |
tree | 7a33e83753c8db062e024e30635d1349dc2275df /industry.h | |
parent | d039d332ecbb96186249208e5692f900ef2ec07e (diff) | |
download | openttd-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.h | 35 |
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); |