48 constexpr void SetIndex(
SourceID index) { this->
id = index; }
51 constexpr bool IsValid() const noexcept {
return this->
id !=
Source::Invalid; }
52 auto operator<=>(
const Source &source)
const =
default;
Types related to companies.
A type is considered 'convertible through base()' when it has a 'base()' function that returns someth...
Types related to the industry.
std::variant< std::monostate, TileIndex, VehicleID, StationID, IndustryID, TownID, EngineID > NewsReference
References to objects in news.
uint16_t SourceID
Contains either industry ID, town ID or company ID (or Source::Invalid)
SourceType
Types of cargo source and destination.
@ Industry
Source/destination is an industry.
@ Headquarters
Source/destination are company headquarters.
@ Town
Source/destination is a town.
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Defines the internal data of a functional industry.
A location from where cargo can come from (or go to).
static constexpr SourceID Invalid
Invalid/unknown index of source.
SourceID id
Index of industry/town/HQ, Source::Invalid if unknown/invalid.
StringID GetFormat() const
Get the format string for a subsidy Source.
NewsReference GetNewsReference() const
Get the NewsReference for a subsidy Source.
SourceType type
Type of source_id.