OpenTTD Source 20250331-master-g3c15e0c889
|
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 |
NewsReference | GetNewsReference () const |
Get the NewsReference for a subsidy Source. | |
StringID | GetFormat () const |
Get the format string for a subsidy Source. | |
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 32 of file source_type.h.
|
inline |
Definition at line 40 of file source_type.h.
|
inline |
Definition at line 41 of file source_type.h.
StringID Source::GetFormat | ( | ) | const |
Get the format string for a subsidy Source.
Definition at line 56 of file subsidy.cpp.
References Industry, Town, and type.
Referenced by CreateSubsidy(), and SubsidyListWindow::DrawWidget().
NewsReference Source::GetNewsReference | ( | ) | const |
Get the NewsReference for a subsidy Source.
Definition at line 43 of file subsidy.cpp.
References Industry, and Town.
Referenced by Subsidy::AwardTo(), and CreateSubsidy().
|
inlineconstexprnoexcept |
Definition at line 51 of file source_type.h.
|
inlineconstexpr |
Definition at line 47 of file source_type.h.
|
inlineconstexpr |
Definition at line 49 of file source_type.h.
|
inlineconstexpr |
Definition at line 48 of file source_type.h.
|
inlineconstexpr |
Definition at line 43 of file source_type.h.
|
inlineconstexpr |
Definition at line 44 of file source_type.h.
|
inlineconstexpr |
Definition at line 45 of file source_type.h.
SourceID Source::id |
Index of industry/town/HQ, Source::Invalid if unknown/invalid.
Definition at line 36 of file source_type.h.
Referenced by CreateSubsidy(), and SubsidyListWindow::DrawWidget().
|
staticconstexpr |
Invalid/unknown index of source.
Definition at line 34 of file source_type.h.
Referenced by FindSubsidyCargoDestination().
SourceType Source::type |
Type of source_id
.
Definition at line 37 of file source_type.h.
Referenced by AddCargoDelivery(), CheckSubsidised(), CheckSubsidyDistance(), CmdCreateSubsidy(), DeliverGoods(), GetFormat(), and SetPartOfSubsidyFlag().