OpenTTD: VehicleOrderSaver Class Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Private Attributes
VehicleOrderSaver Class Reference

This class will save the current order of a vehicle and restore it on destruction. More...

## Public Member Functions
| VehicleOrderSaver (Train *_v)
bool | SwitchToNextOrder (bool skip_first)
| Set the current vehicle order to the next order in the order list.

## Private Attributes
Train * | v
Order | old_order
TileIndex | old_dest_tile
StationID | old_last_station_visited
VehicleOrderID | index
bool | suppress_implicit_orders

## Detailed Description

This class will save the current order of a vehicle and restore it on destruction.

Definition at line 2438 of file train_cmd.cpp.

## Member Function Documentation

bool VehicleOrderSaver::SwitchToNextOrder | ( | bool | skip_first | ) |
| inline

Set the current vehicle order to the next order in the order list.

Parameters

  skip_first | Shall the first (i.e. active) order be skipped?

Returns
  True if a suitable next order could be found.

Definition at line 2471 of file train_cmd.cpp.

References BaseConsist::cur_real_order_index, Vehicle::current_order, Order::GetDepotOrderType(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Order::GetType(), INVALID_VEH_ORDER_ID, Vehicle::NeedsServicing(), ODTFB_SERVICE, ProcessConditionalOrder(), and UpdateOrderDest().

The documentation for this class was generated from the following file:

- src/train_cmd.cpp