OpenTTD Source: src/industry_cmd.h Source File

OpenTTD Source 15.0-RC2

industry_cmd.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef INDUSTRY_CMD_H
11#define INDUSTRY_CMD_H
12
13#include "command_type.h"
14#include "company_type.h"
15#include "industry_type.h"
16#include "industry.h"
17
18 CommandCost CmdBuildIndustry(DoCommandFlags flags, TileIndex tile, IndustryType it, uint32_t first_layout, bool fund, uint32_t seed);
19 CommandCost CmdIndustrySetFlags(DoCommandFlags flags, IndustryID ind_id, IndustryControlFlags ctlflags);
20 CommandCost CmdIndustrySetExclusivity(DoCommandFlags flags, IndustryID ind_id, Owner company_id, bool consumer);
21 CommandCost CmdIndustrySetText(DoCommandFlags flags, IndustryID ind_id, const EncodedString &text);
22 CommandCost CmdIndustrySetProduction(DoCommandFlags flags, IndustryID ind_id, uint8_t prod_level, bool show_news, const EncodedString &text);
23
24DEF_CMD_TRAIT(CMD_BUILD_INDUSTRY, CmdBuildIndustry, CommandFlag::Deity, CommandType::LandscapeConstruction)
25DEF_CMD_TRAIT(CMD_INDUSTRY_SET_FLAGS, CmdIndustrySetFlags, CommandFlag::Deity, CommandType::OtherManagement)
26DEF_CMD_TRAIT(CMD_INDUSTRY_SET_EXCLUSIVITY, CmdIndustrySetExclusivity, CommandFlag::Deity, CommandType::OtherManagement)
27DEF_CMD_TRAIT(CMD_INDUSTRY_SET_TEXT, CmdIndustrySetText, CommandFlags({CommandFlag::Deity, CommandFlag::StrCtrl}), CommandType::OtherManagement)
28DEF_CMD_TRAIT(CMD_INDUSTRY_SET_PRODUCTION, CmdIndustrySetProduction, CommandFlag::Deity, CommandType::OtherManagement)
29
30#endif /* INDUSTRY_CMD_H */
CommandCost
Common return value for all commands.
Definition command_type.h:24
EncodedString
Container for an encoded string, created by GetEncodedString.
Definition strings_type.h:98
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
command_type.h
Types related to commands.
CommandType::OtherManagement
@ OtherManagement
Renaming stuff, changing company colours, placing signs, etc.
CommandType::LandscapeConstruction
@ LandscapeConstruction
Construction and destruction of objects on the map.
CommandFlag::Deity
@ Deity
the command may be executed by COMPANY_DEITY
CommandFlag::StrCtrl
@ StrCtrl
the command's string may contain control strings
CMD_INDUSTRY_SET_FLAGS
@ CMD_INDUSTRY_SET_FLAGS
change industry control flags
Definition command_type.h:259
CMD_INDUSTRY_SET_TEXT
@ CMD_INDUSTRY_SET_TEXT
change additional text for the industry
Definition command_type.h:261
CMD_INDUSTRY_SET_EXCLUSIVITY
@ CMD_INDUSTRY_SET_EXCLUSIVITY
change industry exclusive consumer/supplier
Definition command_type.h:260
CMD_INDUSTRY_SET_PRODUCTION
@ CMD_INDUSTRY_SET_PRODUCTION
change industry production
Definition command_type.h:262
CMD_BUILD_INDUSTRY
@ CMD_BUILD_INDUSTRY
build a new industry
Definition command_type.h:258
company_type.h
Types related to companies.
industry.h
Base of all industries.
CmdIndustrySetExclusivity
CommandCost CmdIndustrySetExclusivity(DoCommandFlags flags, IndustryID ind_id, Owner company_id, bool consumer)
Change exclusive consumer or supplier for the industry.
Definition industry_cmd.cpp:2233
CmdBuildIndustry
CommandCost CmdBuildIndustry(DoCommandFlags flags, TileIndex tile, IndustryType it, uint32_t first_layout, bool fund, uint32_t seed)
Build/Fund an industry.
Definition industry_cmd.cpp:2064
CmdIndustrySetFlags
CommandCost CmdIndustrySetFlags(DoCommandFlags flags, IndustryID ind_id, IndustryControlFlags ctlflags)
Set industry control flags.
Definition industry_cmd.cpp:2156
CmdIndustrySetProduction
CommandCost CmdIndustrySetProduction(DoCommandFlags flags, IndustryID ind_id, uint8_t prod_level, bool show_news, const EncodedString &text)
Set industry production.
Definition industry_cmd.cpp:2178
CmdIndustrySetText
CommandCost CmdIndustrySetText(DoCommandFlags flags, IndustryID ind_id, const EncodedString &text)
Change additional industry text.
Definition industry_cmd.cpp:2262
industry_type.h
Types related to the industry.
PoolID
Templated helper to make a PoolID a single POD value.
Definition pool_type.hpp:43
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >