timetable_cmd.cpp File Reference

Commands related to time tabling. More...

#include "stdafx.h"
#include "command_func.h"
#include "functions.h"
#include "window_func.h"
#include "vehicle_base.h"
#include "settings_type.h"
#include "table/strings.h"

Go to the source code of this file.

Functions

static void ChangeTimetable (Vehicle *v, VehicleOrderID order_number, uint16 time, bool is_journey)
CommandCost CmdChangeTimetable (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Add or remove waiting times from an order.
CommandCost CmdSetVehicleOnTime (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Clear the lateness counter to make the vehicle on time.
CommandCost CmdAutofillTimetable (TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 Start or stop filling the timetable automatically from the time the vehicle actually takes to complete it.
void UpdateVehicleTimetable (Vehicle *v, bool travelling)


Detailed Description

Commands related to time tabling.

Definition in file timetable_cmd.cpp.


Function Documentation

CommandCost CmdAutofillTimetable ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Start or stop filling the timetable automatically from the time the vehicle actually takes to complete it.

When starting to autofill the current times are cleared and the timetable will start again from scratch.

Parameters:
tile Not used.
flags Operation to perform.
p1 Vehicle index.
p2 Various bitstuffed elements
  • p2 = (bit 0) - Set to 1 to enable, 0 to disable autofill.
  • p2 = (bit 1) - Set to 1 to preserve waiting times in non-destructive mode

Definition at line 141 of file timetable_cmd.cpp.

References _settings_game, ClrBit(), CMD_ERROR, DC_EXEC, GB(), HasBit(), InvalidateWindow(), IsValidVehicleID(), GameSettings::order, SetBit(), OrderSettings::timetabling, VF_AUTOFILL_PRES_WAIT_TIME, VF_AUTOFILL_TIMETABLE, and VF_TIMETABLE_STARTED.

CommandCost CmdChangeTimetable ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Add or remove waiting times from an order.

Parameters:
tile Not used.
flags Operation to perform.
p1 Various bitstuffed elements
  • p1 = (bit 0-15) - Vehicle with the orders to change.
  • p1 = (bit 16-23) - Order index to modify.
  • p1 = (bit 24) - Whether to change the waiting time or the travelling time.
  • p1 = (bit 25) - Whether p2 contains waiting and travelling time.
p2 The amount of time to wait.
  • p2 = (bit 0-15) - Waiting or travelling time as specified by p1 bit 24 if p1 bit 25 is not set, Travelling time if p1 bit 25 is set.
  • p2 = (bit 16-31) - Waiting time if p1 bit 25 is set

Definition at line 55 of file timetable_cmd.cpp.

References _settings_game, CMD_ERROR, DC_EXEC, GB(), HasBit(), IsValidVehicleID(), ONSF_NO_STOP_AT_DESTINATION_STATION, GameSettings::order, return_cmd_error, and OrderSettings::timetabling.

CommandCost CmdSetVehicleOnTime ( TileIndex  tile,
DoCommandFlag  flags,
uint32  p1,
uint32  p2,
const char *  text 
)

Clear the lateness counter to make the vehicle on time.

Parameters:
tile Not used.
flags Operation to perform.
p1 Various bitstuffed elements
  • p1 = (bit 0-15) - Vehicle with the orders to change.

Definition at line 113 of file timetable_cmd.cpp.

References _settings_game, CMD_ERROR, DC_EXEC, GB(), IsValidVehicleID(), GameSettings::order, and OrderSettings::timetabling.


Generated on Fri Jul 31 22:33:29 2009 for OpenTTD by  doxygen 1.5.6