OpenTTD
Data Structures | Macros | 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...
 

Macros

#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. More...
 
bool IsTileForestIndustry (TileIndex tile)
 Check whether the tile is a forest. More...
 

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

◆ 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

◆ IsTileForestIndustry()

bool IsTileForestIndustry ( TileIndex  tile)

Check whether the tile is a forest.

Parameters
tilethe tile to investigate.
Returns
true if and only if the tile is a forest

Definition at line 931 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.

◆ ReleaseDisastersTargetingIndustry()

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
ideleted industry

Definition at line 943 of file disaster_vehicle.cpp.

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