~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/industry.h

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: industry.h 12041 2008-02-02 03:23:26Z belugas $ */
 
1
/* $Id: industry.h 15726 2009-03-15 16:04:39Z smatz $ */
2
2
 
3
 
/** @file industry.h */
 
3
/** @file industry.h Base of all industries. */
4
4
 
5
5
#ifndef INDUSTRY_H
6
6
#define INDUSTRY_H
15
15
#include "date_type.h"
16
16
#include "town_type.h"
17
17
#include "industry_type.h"
18
 
#include "newgrf_string_type.h"
 
18
#include "landscape_type.h"
19
19
 
20
20
enum {
21
21
        INVALID_INDUSTRY       = 0xFFFF,
69
69
        INDUSTRYBEH_PLANT_FIELDS          = 1 << 0,  ///< periodically plants fileds around itself (temp and artic farms)
70
70
        INDUSTRYBEH_CUT_TREES             = 1 << 1,  ///< cuts trees and produce first output cargo from them (lumber mill)
71
71
        INDUSTRYBEH_BUILT_ONWATER         = 1 << 2,  ///< is built on water (oil rig)
72
 
        INDUSTRYBEH_TOWN1200_MORE         = 1 << 3,  ///< can only be built in towns larger then 1200 inhabitants (temperate bank)
 
72
        INDUSTRYBEH_TOWN1200_MORE         = 1 << 3,  ///< can only be built in towns larger than 1200 inhabitants (temperate bank)
73
73
        INDUSTRYBEH_ONLY_INTOWN           = 1 << 4,  ///< can only be built in towns (arctic/tropic banks, water tower)
74
74
        INDUSTRYBEH_ONLY_NEARTOWN         = 1 << 5,  ///< is always built near towns (toy shop)
75
75
        INDUSTRYBEH_PLANT_ON_BUILT        = 1 << 6,  ///< Fields are planted around when built (all farms)
117
117
 
118
118
        IndustryType type;                  ///< type of industry.
119
119
        OwnerByte owner;                    ///< owner of the industry.  Which SHOULD always be (imho) OWNER_NONE
120
 
        byte random_color;                  ///< randomized colour of the industry, for display purpose
 
120
        byte random_colour;                 ///< randomized colour of the industry, for display purpose
121
121
        Year last_prod_year;                ///< last year of production
122
122
        byte was_cargo_delivered;           ///< flag that indicate this has been the closest industry chosen for cargo delivery by a station. see DeliverGoodsToIndustry
123
123
 
132
132
 
133
133
        PersistentStorage psa;              ///< Persistent storage for NewGRF industries.
134
134
 
135
 
        Industry(TileIndex tile = 0) : xy(tile) {}
 
135
        Industry(TileIndex tile = INVALID_TILE) : xy(tile) {}
136
136
        ~Industry();
137
137
 
138
 
        inline bool IsValid() const { return this->xy != 0; }
 
138
        inline bool IsValid() const { return this->xy != INVALID_TILE; }
139
139
};
140
140
 
141
141
struct IndustryTileTable {
156
156
 * Defines the data structure for constructing industry.
157
157
 */
158
158
struct IndustrySpec {
159
 
        const IndustryTileTable *const *table;///< List of the tiles composing the industry
 
159
        const IndustryTileTable * const *table;///< List of the tiles composing the industry
160
160
        byte num_table;                       ///< Number of elements in the table
161
161
        uint8 cost_multiplier;                ///< Base construction cost multiplier.
162
162
        uint32 removal_cost_multiplier;       ///< Base removal cost multiplier.
174
174
        byte climate_availability;            ///< Bitmask, giving landscape enums as bit position
175
175
        IndustryBehaviour behaviour;           ///< How this industry will behave, and how others entities can use it
176
176
        byte map_colour;                      ///< colour used for the small map
177
 
        GRFMappedStringID name;               ///< Displayed name of the industry
178
 
        GRFMappedStringID new_industry_text;  ///< Message appearing when the industry is built
179
 
        GRFMappedStringID closure_text;       ///< Message appearing when the industry closes
180
 
        GRFMappedStringID production_up_text; ///< Message appearing when the industry's production is increasing
181
 
        GRFMappedStringID production_down_text; ///< Message appearing when the industry's production is decreasing
182
 
        GRFMappedStringID station_name;       ///< Default name for nearby station
 
177
        StringID name;                        ///< Displayed name of the industry
 
178
        StringID new_industry_text;           ///< Message appearing when the industry is built
 
179
        StringID closure_text;                ///< Message appearing when the industry closes
 
180
        StringID production_up_text;          ///< Message appearing when the industry's production is increasing
 
181
        StringID production_down_text;        ///< Message appearing when the industry's production is decreasing
 
182
        StringID station_name;                ///< Default name for nearby station
183
183
        byte appear_ingame[NUM_LANDSCAPE];    ///< Probability of appearance in game
184
184
        byte appear_creation[NUM_LANDSCAPE];  ///< Probability of appearance during map creation
185
185
        uint8 number_of_sounds;               ///< Number of sounds available in the sounds array
238
238
void ResetIndustries();
239
239
void PlantRandomFarmField(const Industry *i);
240
240
 
 
241
void ReleaseDisastersTargetingIndustry(IndustryID);
 
242
 
241
243
/* writable arrays of specs */
242
244
extern IndustrySpec _industry_specs[NUM_INDUSTRYTYPES];
243
245
extern IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES];
260
262
 
261
263
/* smallmap_gui.cpp */
262
264
void BuildIndustriesLegend();
 
265
/* industry_cmd.cpp */
 
266
void SetIndustryDailyChanges();
263
267
 
264
268
/**
265
269
 * Check if an Industry exists whithin the pool of industries
354
358
#define FOR_ALL_INDUSTRIES_FROM(i, start) for (i = GetIndustry(start); i != NULL; i = (i->index + 1U < GetIndustryPoolSize()) ? GetIndustry(i->index + 1U) : NULL) if (i->IsValid())
355
359
#define FOR_ALL_INDUSTRIES(i) FOR_ALL_INDUSTRIES_FROM(i, 0)
356
360
 
357
 
extern const Industry **_industry_sort;
358
 
extern bool _industry_sort_dirty;
359
 
 
360
361
static const uint8 IT_INVALID = 255;
361
362
 
362
363
#endif /* INDUSTRY_H */