A vehicle is one of the fundamental entities in the game.
There are 6 recognised vehicle types in the VehicleType enum:
- VEH_TRAIN: A train or carriage. Makes use of a linked list for the carriages.
- VEH_ROAD: A bus or truck. Will probably use the same linked list for articulated vehicles.
The Vehicle struct has many variables and methods. Some of the important ones are:
|VehicleTypeByte type||The vehicle type|
|PlayerByte owner||owner of the vehicle|
Its current location
x_pos and y_pos are world coordinates in 1/16th of a tile.
|TextEffectID fill_percent_te_id||a text-effect id to a loading indicator object|
|Speed of the train|
|Acceleration and max speed|
|Type and amount of cargo|
|Order *orders||Linked list of orders|
|Entering and leaving a station|
There are many more methods and variables than this. For more info, see vehicle_base.h and vehicle.cpp. Vehicles are all subclassed, so there are other more specific methods and variables for trains, etc.