Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

# industry.h File Reference

Base of all industries. More...

`#include "newgrf_storage.h"`
`#include "subsidy_type.h"`
`#include "industry_map.h"`
`#include "tilearea_type.h"`

Go to the source code of this file.

## Data Structures
struct | Industry
| Defines the internal data of a functional industry. More...
struct | IndustryTypeBuildData
| Data for managing the number of industries of a single industry type. More...
struct | IndustryBuildData
| Data for managing the number and type of industries in the game. More...
## Defines
#define | FOR_ALL_INDUSTRIES_FROM(var, start) FOR_ALL_ITEMS_FROM(Industry, industry_index, var, start)
#define | FOR_ALL_INDUSTRIES(var) FOR_ALL_INDUSTRIES_FROM(var, 0)
## Typedefs
typedef Pool< Industry, IndustryID, 64, 64000 > | IndustryPool
## Enumerations
enum | ProductionLevels { PRODLEVEL_CLOSURE = 0x00, PRODLEVEL_MINIMUM = 0x04, PRODLEVEL_DEFAULT = 0x10, PRODLEVEL_MAXIMUM = 0x80 }
| Production level maximum, minimum and default values. More...
## Functions
void | PlantRandomFarmField (const Industry *i)
void | ReleaseDisastersTargetingIndustry (IndustryID)
| Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile) on invalid industry anymore.
bool | IsTileForestIndustry (TileIndex tile)
| Check whether the tile is a forest.
## Variables
IndustryPool | _industry_pool
IndustryBuildData | _industry_builder
| In-game manager of industries.

## Detailed Description

Base of all industries.

Definition in file industry.h.

## Enumeration Type Documentation

enum ProductionLevels

Production level maximum, minimum and default values.

It is not a value been really used in order to change, but rather an indicator of how the industry is behaving.

Enumerator:

  PRODLEVEL_CLOSURE | signal set to actually close the industry
  PRODLEVEL_MINIMUM | below this level, the industry is set to be closing
  PRODLEVEL_DEFAULT | default level set when the industry is created
  PRODLEVEL_MAXIMUM | the industry is running at full speed

Definition at line 29 of file industry.h.

## Function Documentation

bool IsTileForestIndustry | ( | TileIndex | tile | ) |

Check whether the tile is a forest.

Parameters:

  | tile | the tile to investigate.

Returns:
  true if and only if the tile is a forest

Definition at line 921 of file industry_cmd.cpp.

References CT_INVALID, CargoSpec::Get(), Industry::GetByTile(), GetIndustrySpec(), INDUSTRYLIFE_ORGANIC, IsTileType(), CargoSpec::label, lengthof, IndustrySpec::life_type, MP_INDUSTRY, Industry::produced_cargo, and Industry::type.

Referenced by GetSmallMapVegetationPixels().

void ReleaseDisastersTargetingIndustry | ( | IndustryID | i | ) |

Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile) on invalid industry anymore.

Parameters:

  | i | deleted industry

Definition at line 956 of file disaster_cmd.cpp.

References Vehicle::current_order, Vehicle::dest_tile, FOR_ALL_DISASTERVEHICLES, Order::GetDestination(), Order::SetDestination(), and Vehicle::subtype.