OpenTTD
|
Allow incrementing of ObjectClassID variables. More...
#include <newgrf_object.h>
Public Member Functions | |
Money | GetBuildCost () const |
Get the cost for building a structure of this type. | |
Money | GetClearCost () const |
Get the cost for clearing a structure of this type. | |
bool | IsEverAvailable () const |
Check whether the object might be available at some point in this game with the current game mode. | |
bool | WasEverAvailable () const |
Check whether the object was available at some point in the past or present in this game with the current game mode. | |
bool | IsAvailable () const |
Check whether the object is available at this time. | |
uint | Index () const |
Gets the index of this spec. |
Static Public Member Functions | |
static const ObjectSpec * | Get (ObjectType index) |
Get the specification associated with a specific ObjectType. | |
static const ObjectSpec * | GetByTile (TileIndex tile) |
Get the specification associated with a tile. |
Data Fields | |
GRFFilePropsBase< 2 > | grf_prop |
Properties related the the grf file. | |
ObjectClassID | cls_id |
The class to which this spec belongs. | |
StringID | name |
The name for this object. | |
uint8 | climate |
In which climates is this object available? | |
uint8 | size |
The size of this objects; low nibble for X, high nibble for Y. | |
uint8 | build_cost_multiplier |
Build cost multiplier per tile. | |
uint8 | clear_cost_multiplier |
Clear cost multiplier per tile. | |
Date | introduction_date |
From when can this object be built. | |
Date | end_of_life_date |
When can't this object be built anymore. | |
ObjectFlags | flags |
Flags/settings related to the object. | |
AnimationInfo | animation |
Information about the animation. | |
uint16 | callback_mask |
Bitmask of requested/allowed callbacks. | |
uint8 | height |
The height of this structure, in heightlevels; max MAX_TILE_HEIGHT. | |
uint8 | views |
The number of views. | |
uint8 | generate_amount |
Number of objects which are attempted to be generated per 256^2 map during world generation. | |
bool | enabled |
Is this spec enabled? |
Allow incrementing of ObjectClassID variables.
An object that isn't use for transport, industries or houses.
Definition at line 60 of file newgrf_object.h.
|
static |
Get the specification associated with a specific ObjectType.
index | The object type to fetch. |
Definition at line 41 of file newgrf_object.cpp.
References NUM_OBJECTS.
Referenced by BuildObject(), CmdBuildObject(), GetByTile(), GetObjectIDAtOffset(), and BuildObjectWindow::UpdateWidgetSize().
|
inline |
Get the cost for building a structure of this type.
Definition at line 84 of file newgrf_object.h.
References GetPrice(), and GRFFilePropsBase< Tcnt >::grffile.
|
static |
Get the specification associated with a tile.
tile | The tile to fetch the data for. |
Definition at line 52 of file newgrf_object.cpp.
References Get(), and GetObjectType().
Referenced by AnimateNewObjectTile(), CmdBuildBridge(), and UpdateObjectColours().
|
inline |
Get the cost for clearing a structure of this type.
Definition at line 90 of file newgrf_object.h.
References GetPrice(), and GRFFilePropsBase< Tcnt >::grffile.
uint ObjectSpec::Index | ( | ) | const |
Gets the index of this spec.
Definition at line 90 of file newgrf_object.cpp.
References _object_specs.
bool ObjectSpec::IsAvailable | ( | ) | const |
Check whether the object is available at this time.
Definition at line 80 of file newgrf_object.cpp.
References _date, end_of_life_date, introduction_date, and WasEverAvailable().
Referenced by CmdBuildObject(), BuildObjectWindow::DrawWidget(), and BuildObjectWindow::SelectFirstAvailableObject().
bool ObjectSpec::IsEverAvailable | ( | ) | const |
Check whether the object might be available at some point in this game with the current game mode.
Definition at line 61 of file newgrf_object.cpp.
References _generating_world, _settings_game, climate, enabled, flags, GameSettings::game_creation, HasBit(), GameCreationSettings::landscape, OBJECT_FLAG_ONLY_IN_GAME, and OBJECT_FLAG_ONLY_IN_SCENEDIT.
Referenced by BuildObjectWindow::UpdateWidgetSize(), and WasEverAvailable().
bool ObjectSpec::WasEverAvailable | ( | ) | const |
Check whether the object was available at some point in the past or present in this game with the current game mode.
Definition at line 71 of file newgrf_object.cpp.
References _date, introduction_date, and IsEverAvailable().
Referenced by CmdBuildObject(), and IsAvailable().