Struct about subsidies, offered and awarded. More...
#include <subsidy_base.h>
Public Member Functions | |
| FORCEINLINE | Subsidy () |
| We need an (empty) constructor so struct isn't zeroed (as C++ standard states). | |
| FORCEINLINE | ~Subsidy () |
| (Empty) destructor has to be defined else operator delete might be called with NULL parameter | |
| FORCEINLINE bool | IsAwarded () const |
| Tests whether this subsidy has been awarded to someone. | |
| void | AwardTo (CompanyID company) |
| Marks subsidy as awarded, creates news and AI event. | |
Data Fields | |
| CargoID | cargo_type |
| Cargo type involved in this subsidy, CT_INVALID for invalid subsidy. | |
| byte | remaining |
| Remaining months when this subsidy is valid. | |
| CompanyByte | awarded |
| Subsidy is awarded to this company; INVALID_COMPANY if it's not awarded to anyone. | |
| SourceTypeByte | src_type |
| Source of subsidised path (ST_INDUSTRY or ST_TOWN). | |
| SourceTypeByte | dst_type |
| Destination of subsidised path (ST_INDUSTRY or ST_TOWN). | |
| SourceID | src |
| Index of source. Either TownID or IndustryID. | |
| SourceID | dst |
| Index of destination. Either TownID or IndustryID. | |
Struct about subsidies, offered and awarded.
Definition at line 24 of file subsidy_base.h.
| void Subsidy::AwardTo | ( | CompanyID | company | ) |
Marks subsidy as awarded, creates news and AI event.
| company | awarded company |
Definition at line 36 of file subsidy.cpp.
References _settings_game, AddNewsItem(), AI::BroadcastNewEvent(), GameSettings::difficulty, InjectDParam(), InvalidateWindowData(), lastof, MAX_CHAR_LENGTH, MAX_LENGTH_COMPANY_NAME_CHARS, NS_SUBSIDIES, SetDParam(), SetDParamStr(), SUBSIDY_CONTRACT_MONTHS, and DifficultySettings::subsidy_multiplier.
Referenced by CheckSubsidised().
| FORCEINLINE bool Subsidy::IsAwarded | ( | ) | const [inline] |
Tests whether this subsidy has been awarded to someone.
Definition at line 47 of file subsidy_base.h.
References awarded.
Referenced by CheckSubsidised(), SubsidyListWindow::CountLines(), SubsidyListWindow::DrawWidget(), and SubsidyListWindow::OnClick().
1.7.1