Struct containing information relating to NewGRF classes for stations and airports. More...
#include <newgrf_class.h>
Static Public Member Functions | |
| static void | Reset () |
| Reset the classes, i.e. | |
| static void | InsertDefaults () |
| Initialise the defaults. | |
| static Tid | Allocate (uint32 global_id) |
| Allocate a class with a given global class ID. | |
| static void | SetName (Tid cls_id, StringID name) |
| Set the name of a particular class. | |
| static void | Assign (Tspec *spec) |
| Assign a spec to one of the classes. | |
| static StringID | GetName (Tid cls_id) |
| Get the name of a particular class. | |
| static uint | GetCount () |
| Get the number of allocated classes. | |
| static uint | GetCount (Tid cls_id) |
| Get the number of allocated specs within a particular class. | |
| static const Tspec * | Get (Tid cls_id, uint index) |
| Get a spec from a particular class at a given index. | |
| static const Tspec * | GetByGrf (uint32 grfid, byte local_id, int *index) |
| Retrieve a spec by GRF location. | |
Data Fields | |
| uint32 | global_id |
| Global ID for class, e.g. 'DFLT', 'WAYP', etc. | |
| StringID | name |
| Name of this class. | |
| uint | count |
| Number of stations in this class. | |
| Tspec ** | spec |
| Array of station specifications. | |
Static Public 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.
| static Tid NewGRFClass< Tspec, Tid, Tmax >::Allocate | ( | uint32 | global_id | ) | [static] |
Allocate a class with a given global class ID.
| cls_id | The global class id, such as 'DFLT'. |
Referenced by NewGRFClass< Tspec, Tid, Tmax >::InsertDefaults().
| static void NewGRFClass< Tspec, Tid, Tmax >::Assign | ( | Tspec * | spec | ) | [static] |
Assign a spec to one of the classes.
| spec | The spec to assign. |
Referenced by BindAirportSpecs(), and ObjectOverrideManager::SetEntitySpec().
| static const Tspec* NewGRFClass< Tspec, Tid, Tmax >::Get | ( | Tid | cls_id, | |
| uint | index | |||
| ) | [static] |
Get a spec from a particular class at a given index.
| cls_id | The class to get the spec from. | |
| index | The index where to find the spec. |
Referenced by CmdBuildRailStation(), CmdBuildRailWaypoint(), DrawStationTile(), BuildRailWaypointWindow::DrawWidget(), BuildRailStationWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), BuildAirportWindow::DrawWidget(), MoveWaypointsToBaseStations(), BuildRailWaypointWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildObjectWindow::OnClick(), BuildAirportWindow::OnClick(), BuildRailStationWindow::OnPaint(), BuildAirportWindow::OnPaint(), PlaceAirport(), PlaceProc_Object(), BuildAirportWindow::SelectFirstAvailableAirport(), BuildObjectWindow::SelectFirstAvailableObject(), BuildObjectWindow::SelectOtherObject(), BuildRailStationWindow::SetStringParameters(), BuildObjectWindow::SetStringParameters(), BuildAirportWindow::SetStringParameters(), BuildRailStationWindow::UpdateWidgetSize(), and BuildObjectWindow::UpdateWidgetSize().
| static const Tspec* NewGRFClass< Tspec, Tid, Tmax >::GetByGrf | ( | uint32 | grfid, | |
| byte | local_id, | |||
| int * | index | |||
| ) | [static] |
Retrieve a spec by GRF location.
| grfid | GRF ID of spec. | |
| local_id | Index within GRF file of spec. | |
| index | Pointer to return the index of the spec in its class. If NULL then not used. |
Referenced by AIRail::BuildNewGRFRailStation().
| static uint NewGRFClass< Tspec, Tid, Tmax >::GetCount | ( | Tid | cls_id | ) | [static] |
Get the number of allocated specs within a particular class.
| cls_id | The class to get the size of. |
| static uint NewGRFClass< Tspec, Tid, Tmax >::GetCount | ( | ) | [static] |
Get the number of allocated classes.
Referenced by BuildAirportWindow::BuildAirportClassDropDown(), CmdBuildRailStation(), CmdBuildRailWaypoint(), BuildRailStationWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), BuildAirportWindow::DrawWidget(), MoveWaypointsToBaseStations(), TerraformToolbarWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildRailToolbarWindow::OnClick(), BuildObjectWindow::OnClick(), BuildAirportWindow::OnDropdownSelect(), TerraformToolbarWindow::OnInit(), BuildAirportWindow::SelectFirstAvailableAirport(), BuildObjectWindow::SelectFirstAvailableObject(), ShowStationBuilder(), BuildRailStationWindow::UpdateWidgetSize(), BuildObjectWindow::UpdateWidgetSize(), and BuildAirportWindow::UpdateWidgetSize().
| static StringID NewGRFClass< Tspec, Tid, Tmax >::GetName | ( | Tid | cls_id | ) | [static] |
Get the name of a particular class.
| cls_id | The class to get the name of. |
Referenced by BuildAirportWindow::BuildAirportClassDropDown(), BuildRailStationWindow::DrawWidget(), BuildObjectWindow::DrawWidget(), BuildAirportWindow::SetStringParameters(), BuildRailStationWindow::UpdateWidgetSize(), BuildObjectWindow::UpdateWidgetSize(), and BuildAirportWindow::UpdateWidgetSize().
| void NewGRFClass< Tspec, Tid, Tmax >::InsertDefaults | ( | ) | [inline, static] |
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 27 of file newgrf_airport.cpp.
References NewGRFClass< Tspec, Tid, Tmax >::Allocate(), and NewGRFClass< Tspec, Tid, Tmax >::SetName().
| static void NewGRFClass< Tspec, Tid, Tmax >::Reset | ( | ) | [static] |
| static void NewGRFClass< Tspec, Tid, Tmax >::SetName | ( | Tid | cls_id, | |
| StringID | name | |||
| ) | [static] |
Set the name of a particular class.
| cls_id | The id for the class. |
| name | The new name for the class. |
Referenced by NewGRFClass< Tspec, Tid, Tmax >::InsertDefaults().
NewGRFClass< Tspec, Tid, Tmax > NewGRFClass< Tspec, Tid, Tmax >::classes [inline, static] |
1.6.1