Subsidy Struct Reference

Struct about subsidies, offered and awarded. More...

#include <subsidy_base.h>

Inheritance diagram for Subsidy:
Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_subsidy_pool >

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.

Detailed Description

Struct about subsidies, offered and awarded.

Definition at line 24 of file subsidy_base.h.


Member Function Documentation

void Subsidy::AwardTo ( CompanyID  company  ) 
FORCEINLINE bool Subsidy::IsAwarded (  )  const [inline]

Tests whether this subsidy has been awarded to someone.

Returns:
is this subsidy awarded?

Definition at line 47 of file subsidy_base.h.

References awarded, and INVALID_COMPANY.

Referenced by CheckSubsidised(), SubsidyListWindow::CountLines(), SubsidyListWindow::DrawWidget(), and SubsidyListWindow::OnClick().


The documentation for this struct was generated from the following files:

Generated on Tue Sep 14 17:07:53 2010 for OpenTTD by  doxygen 1.6.1