OpenTTD Source 20250222-master-g9a8d9e4e48
|
A location from where cargo can come from (or go to). More...
#include <source_type.h>
Public Member Functions | |
Source (ConvertibleThroughBase auto id, SourceType type) | |
Source (SourceID id, SourceType type) | |
constexpr CompanyID | ToCompanyID () const |
constexpr IndustryID | ToIndustryID () const |
constexpr TownID | ToTownID () const |
constexpr void | MakeInvalid () |
constexpr void | SetIndex (SourceID index) |
constexpr void | SetIndex (ConvertibleThroughBase auto index) |
constexpr bool | IsValid () const noexcept |
auto | operator<=> (const Source &source) const =default |
Data Fields | |
SourceID | id |
Index of industry/town/HQ, Source::Invalid if unknown/invalid. | |
SourceType | type |
Type of source_id . | |
Static Public Attributes | |
static constexpr SourceID | Invalid = 0xFFFF |
Invalid/unknown index of source. | |
A location from where cargo can come from (or go to).
Specifically industries, towns and headquarters.
Definition at line 30 of file source_type.h.
|
inline |
Definition at line 38 of file source_type.h.
|
inline |
Definition at line 39 of file source_type.h.
|
inlineconstexprnoexcept |
Definition at line 49 of file source_type.h.
|
inlineconstexpr |
Definition at line 45 of file source_type.h.
|
inlineconstexpr |
Definition at line 47 of file source_type.h.
|
inlineconstexpr |
Definition at line 46 of file source_type.h.
|
inlineconstexpr |
Definition at line 41 of file source_type.h.
|
inlineconstexpr |
Definition at line 42 of file source_type.h.
|
inlineconstexpr |
Definition at line 43 of file source_type.h.
SourceID Source::id |
Index of industry/town/HQ, Source::Invalid if unknown/invalid.
Definition at line 34 of file source_type.h.
Referenced by SetupSubsidyDecodeParam().
|
staticconstexpr |
Invalid/unknown index of source.
Definition at line 32 of file source_type.h.
Referenced by FindSubsidyCargoDestination().
SourceType Source::type |
Type of source_id
.
Definition at line 35 of file source_type.h.
Referenced by AddCargoDelivery(), CheckSubsidised(), CheckSubsidyDistance(), CmdCreateSubsidy(), DeliverGoods(), SetPartOfSubsidyFlag(), and SetupSubsidyDecodeParam().