OpenTTD Source: src/industry_cmd.h File Reference

OpenTTD Source 13.2.1

Functions
industry_cmd.h File Reference
`#include "command_type.h"`
`#include "company_type.h"`
`#include "industry_type.h"`

Go to the source code of this file.

## Functions
enum IndustryAction byte enum IndustryControlFlags byte CommandCost | CmdBuildIndustry (DoCommandFlag flags, TileIndex tile, IndustryType it, uint32 first_layout, bool fund, uint32 seed)
| Build/Fund an industry. More...
CommandCost | CmdIndustryCtrl (DoCommandFlag flags, IndustryID ind_id, IndustryAction action, IndustryControlFlags ctlflags, Owner company_id, const std::string &text)
| Change industry properties. More...
void | CcBuildIndustry (Commands cmd, const CommandCost &result, TileIndex tile, IndustryType indtype, uint32, bool, uint32)
| Command callback. More...

## Detailed Description

Command definitions related to industries.

Definition in file industry_cmd.h.

## Function Documentation

## ◆ CcBuildIndustry()

void CcBuildIndustry | ( | Commands | cmd,
|  | const CommandCost & | result,
|  | TileIndex | tile,
|  | IndustryType | indtype,
|  | uint32 | ,
|  | bool | ,
|  | uint32 |
| ) |  |

Command callback.

In case of failure to build an industry, show an error message.

Parameters

  cmd | Unused.
  result | Result of the command.
  tile | Tile where the industry is placed.
  indtype | Industry type.

Definition at line 227 of file industry_gui.cpp.

## ◆ CmdBuildIndustry()

enum IndustryAction byte enum IndustryControlFlags byte CommandCost CmdBuildIndustry | ( | DoCommandFlag | flags,
|  | TileIndex | tile,
|  | IndustryType | it,
|  | uint32 | first_layout,
|  | bool | fund,
|  | uint32 | seed
| ) |  |
| strong

Build/Fund an industry.

Parameters

  flags | of operations to conduct
  tile | tile where industry is built
  it | industry type see build_industry.h and see industry.h
  first_layout | first layout to try
  fund | false = prospect, true = fund (only valid if current company is DEITY)
  seed | seed to use for desyncfree randomisations

Returns
  the cost of this operation or an error

Definition at line 2013 of file industry_cmd.cpp.

References CMD_ERROR, IndustrySpec::enabled, GetIndustrySpec(), IndustrySpec::layouts, and NUM_INDUSTRYTYPES.

## ◆ CmdIndustryCtrl()

CommandCost CmdIndustryCtrl | ( | DoCommandFlag | flags,
|  | IndustryID | ind_id,
|  | IndustryAction | action,
|  | IndustryControlFlags | ctlflags,
|  | Owner | company_id,
|  | const std::string & | text
| ) |  |

Change industry properties.

Parameters

  flags | Type of operation.
  ind_id | IndustryID
  action | IndustryAction to perform
  ctlflags | IndustryControlFlags (only used with set control flags)
  company_id | CompanyID to set or INVALID_OWNER (available to everyone) or OWNER_NONE (neutral stations only) or OWNER_DEITY (no one) (only used with set exclusive supplier / consumer)
  text | - Additional industry text (only used with set text action)

Returns
  Empty cost or an error.

Definition at line 2110 of file industry_cmd.cpp.

References _current_company, CMD_ERROR, Industry::ctlflags, DC_EXEC, Industry::exclusive_consumer, Industry::exclusive_supplier, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::GetIfValid(), INDCTL_MASK, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_OWNER, InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), OWNER_DEITY, OWNER_NONE, SetControlFlags, SetExclusiveConsumer, SetExclusiveSupplier, SetText, Industry::text, and WC_INDUSTRY_VIEW.