OpenTTD Source 20260208-master-g43af8e94d0
industry_cmd.h File Reference

Command definitions related to industries. More...

#include "command_type.h"
#include "company_type.h"
#include "industry_type.h"
#include "industry.h"

Go to the source code of this file.

Functions

CommandCost CmdBuildIndustry (DoCommandFlags flags, TileIndex tile, IndustryType it, uint32_t first_layout, bool fund, uint32_t seed)
 Build/Fund an industry.
CommandCost CmdIndustrySetFlags (DoCommandFlags flags, IndustryID ind_id, IndustryControlFlags ctlflags)
 Set industry control flags.
CommandCost CmdIndustrySetExclusivity (DoCommandFlags flags, IndustryID ind_id, Owner company_id, bool consumer)
 Change exclusive consumer or supplier for the industry.
CommandCost CmdIndustrySetText (DoCommandFlags flags, IndustryID ind_id, const EncodedString &text)
 Change additional industry text.
CommandCost CmdIndustrySetProduction (DoCommandFlags flags, IndustryID ind_id, uint8_t prod_level, bool show_news, const EncodedString &text)
 Set industry production.

Detailed Description

Command definitions related to industries.

Definition in file industry_cmd.h.

Function Documentation

◆ CmdBuildIndustry()

CommandCost CmdBuildIndustry ( DoCommandFlags flags,
TileIndex tile,
IndustryType it,
uint32_t first_layout,
bool fund,
uint32_t seed )

◆ CmdIndustrySetExclusivity()

CommandCost CmdIndustrySetExclusivity ( DoCommandFlags flags,
IndustryID ind_id,
Owner company_id,
bool consumer )

Change exclusive consumer or supplier for the industry.

Parameters
flagsType of operation.
ind_idIndustryID
company_idCompanyID to set or INVALID_OWNER (available to everyone) or OWNER_NONE (neutral stations only) or OWNER_DEITY (no one)
consumerSet exclusive consumer if true, supplier if false.
Returns
Empty cost or an error.

Definition at line 2233 of file industry_cmd.cpp.

References _current_company, CMD_ERROR, Industry::exclusive_consumer, Industry::exclusive_supplier, Execute, INVALID_OWNER, OWNER_DEITY, OWNER_NONE, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

◆ CmdIndustrySetFlags()

CommandCost CmdIndustrySetFlags ( DoCommandFlags flags,
IndustryID ind_id,
IndustryControlFlags ctlflags )

Set industry control flags.

Parameters
flagsType of operation.
ind_idIndustryID
ctlflagsIndustryControlFlags
Returns
Empty cost or an error.

Definition at line 2156 of file industry_cmd.cpp.

References _current_company, CMD_ERROR, Industry::ctlflags, Execute, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::IsValid(), OWNER_DEITY, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

◆ CmdIndustrySetProduction()

CommandCost CmdIndustrySetProduction ( DoCommandFlags flags,
IndustryID ind_id,
uint8_t prod_level,
bool show_news,
const EncodedString & custom_news )

◆ CmdIndustrySetText()

CommandCost CmdIndustrySetText ( DoCommandFlags flags,
IndustryID ind_id,
const EncodedString & text )

Change additional industry text.

Parameters
flagsType of operation.
ind_idIndustryID
text- Additional industry text.
Returns
Empty cost or an error.

Definition at line 2262 of file industry_cmd.cpp.

References _current_company, CMD_ERROR, Execute, InvalidateWindowData(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Industry::text, and WC_INDUSTRY_VIEW.