Struct containing information relating to NewGRF classes for stations and airports. More...
#include <newgrf_class.h>
Public Member Functions | |
void | Insert (Tspec *spec) |
uint | GetSpecCount () const |
Get the number of allocated specs within the class. | |
uint | GetUISpecCount () const |
Get the number of potentially user-available specs within the class. | |
int | GetUIFromIndex (int index) const |
int | GetIndexFromUI (int ui_index) const |
const Tspec * | GetSpec (uint index) const |
bool | IsUIAvailable (uint index) const |
Check whether the spec will be available to the user at some point in time. | |
Static Public Member Functions | |
static void | Reset () |
static Tid | Allocate (uint32 global_id) |
static void | Assign (Tspec *spec) |
static uint | GetClassCount () |
static uint | GetUIClassCount () |
static Tid | GetUIClass (uint index) |
static NewGRFClass * | Get (Tid cls_id) |
Get a particular class. | |
static const Tspec * | GetByGrf (uint32 grfid, byte local_id, int *index) |
Data Fields | |
uint32 | global_id |
Global ID for class, e.g. 'DFLT', 'WAYP', etc. | |
StringID | name |
Name of this class. | |
Private Member Functions | |
void | ResetClass () |
Static Private Member Functions | |
static void | InsertDefaults () |
Initialise the defaults. | |
Private Attributes | |
uint | count |
Number of specs in this class. | |
uint | ui_count |
Number of specs in this class potentially available to the user. | |
Tspec ** | spec |
Array of specifications. | |
Static Private Attributes | |
static NewGRFClass< Tspec, Tid, Tmax > | classes [Tmax] |
The actual classes. |
Struct containing information relating to NewGRF classes for stations and airports.
Definition at line 21 of file newgrf_class.h.
NewGRFClass< Tspec, Tid, Tmax > * NewGRFClass< Tspec, Tid, Tmax >::Get | ( | Tid | cls_id | ) | [static] |
Get a particular class.
cls_id | The id for the class. |
Definition at line 105 of file newgrf_class_func.h.
References NewGRFClass< Tspec, Tid, Tmax >::classes.
Referenced by BuildAirportWindow::BuildAirportClassDropDown(), BuildObjectWindow::CanRestoreSelectedObject(), CheckFlatLandRailStation(), CmdBuildRailStation(), CmdBuildRailWaypoint(), DrawStationTile(), BuildRailWaypointWindow::DrawWidget(), BuildRailStationWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), BuildAirportWindow::DrawWidget(), BuildObjectWindow::EnsureSelectedObjectClassIsVisible(), NewGRFClass< Tspec, Tid, Tmax >::InsertDefaults(), MoveWaypointsToBaseStations(), ObjectChangeInfo(), BuildRailWaypointWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildRailToolbarWindow::OnClick(), BuildObjectWindow::OnClick(), BuildAirportWindow::OnClick(), BuildAirportWindow::OnDropdownSelect(), BuildRailStationWindow::OnPaint(), BuildAirportWindow::OnPaint(), PlaceAirport(), PlaceProc_Object(), BuildAirportWindow::SelectFirstAvailableAirport(), BuildObjectWindow::SelectFirstAvailableObject(), BuildObjectWindow::SelectOtherObject(), BuildRailStationWindow::SetStringParameters(), BuildObjectWindow::SetStringParameters(), BuildAirportWindow::SetStringParameters(), ShowStationBuilder(), BuildRailStationWindow::UpdateWidgetSize(), BuildObjectWindow::UpdateWidgetSize(), and BuildAirportWindow::UpdateWidgetSize().
uint NewGRFClass< Tspec, Tid, Tmax >::GetSpecCount | ( | ) | const [inline] |
Get the number of allocated specs within the class.
Definition at line 46 of file newgrf_class.h.
References NewGRFClass< Tspec, Tid, Tmax >::count.
Referenced by BuildObjectWindow::CanRestoreSelectedObject(), CmdBuildRailStation(), BuildAirportWindow::DrawWidget(), MoveWaypointsToBaseStations(), BuildRailStationWindow::OnClick(), BuildRailToolbarWindow::OnClick(), BuildAirportWindow::SelectFirstAvailableAirport(), BuildObjectWindow::SelectFirstAvailableObject(), ShowStationBuilder(), and BuildRailStationWindow::UpdateWidgetSize().
uint NewGRFClass< Tspec, Tid, Tmax >::GetUISpecCount | ( | ) | const [inline] |
Get the number of potentially user-available specs within the class.
Definition at line 48 of file newgrf_class.h.
References NewGRFClass< Tspec, Tid, Tmax >::ui_count.
Referenced by BuildObjectWindow::DrawWidget(), BuildObjectWindow::OnClick(), and BuildObjectWindow::UpdateWidgetSize().
void NewGRFClass< Tspec, Tid, Tmax >::InsertDefaults | ( | ) | [static, private] |
Initialise the defaults.
Reset airport classes to their default state.
This includes initialising the defaults classes with an empty entry, for standard airports.
Definition at line 58 of file newgrf_airport.cpp.
References NewGRFClass< Tspec, Tid, Tmax >::Get(), and NewGRFClass< Tspec, Tid, Tmax >::name.
bool NewGRFClass< Tspec, Tid, Tmax >::IsUIAvailable | ( | uint | index | ) | const |
Check whether the spec will be available to the user at some point in time.
Definition at line 67 of file newgrf_airport.cpp.
NewGRFClass< Tspec, Tid, Tmax > NewGRFClass< Tspec, Tid, Tmax >::classes [static, private] |
The actual classes.
Instantiate the array.
Definition at line 32 of file newgrf_class.h.
Referenced by NewGRFClass< Tspec, Tid, Tmax >::Get().