Class that handles all object-type related functions.
More...
#include <script_objecttype.hpp>
Class that handles all object-type related functions.
◆ BuildObject()
Build an object of the specified type.
- Parameters
-
object_type | The type of the object to build. |
view | The view for teh object. |
tile | The tile to build the object on. |
- Precondition
- IsValidObjectType(object_type).
- Returns
- True if the object was successfully build.
◆ GetName()
static string GSObjectType::GetName |
( |
ObjectType |
object_type | ) |
|
|
static |
Get the name of an object-type.
- Parameters
-
object_type | The type to get the name for. |
- Precondition
- IsValidObjectType(object_type).
- Returns
- The name of an object.
◆ GetViews()
static int GSObjectType::GetViews |
( |
ObjectType |
object_type | ) |
|
|
static |
Get the number of views for an object-type.
- Parameters
-
object_type | The type to get the number of views for. |
- Precondition
- IsValidObjectType(object_type).
- Returns
- The number of views for an object.
◆ IsValidObjectType()
static bool GSObjectType::IsValidObjectType |
( |
ObjectType |
object_type | ) |
|
|
static |
Checks whether the given object-type is valid.
- Parameters
-
object_type | The type to check. |
- Returns
- True if and only if the object-type is valid.
◆ ResolveNewGRFID()
static ObjectType GSObjectType::ResolveNewGRFID |
( |
int |
grfid, |
|
|
int |
grf_local_id |
|
) |
| |
|
static |
Get a specific object-type from a grf.
- Parameters
-
grfid | The ID of the NewGRF. |
grf_local_id | The ID of the object, local to the NewGRF. |
- Precondition
- 0x00 <= grf_local_id < NUM_OBJECTS_PER_GRF.
- Returns
- the object-type ID, local to the current game (this diverges from the grf_local_id).