File diff r13928:43895803afbb → r13929:bc7dece1f96b
src/ai/api/ai_vehicle.cpp
Show inline comments
 
@@ -186,29 +186,25 @@
 
	return ::Vehicle::Get(vehicle_id)->IsStoppedInDepot();
 
}
 

	
 
/* static */ bool AIVehicle::StartStopVehicle(VehicleID vehicle_id)
 
{
 
	EnforcePrecondition(false, IsValidVehicle(vehicle_id));
 

	
 
	return AIObject::DoCommand(0, vehicle_id, 0, CMD_START_STOP_VEHICLE);
 
}
 

	
 
/* static */ bool AIVehicle::SkipToVehicleOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position)
 
{
 
	order_position = AIOrder::ResolveOrderPosition(vehicle_id, order_position);
 

	
 
	EnforcePrecondition(false, AIOrder::IsValidVehicleOrder(vehicle_id, order_position));
 

	
 
	return AIObject::DoCommand(0, vehicle_id, order_position, CMD_SKIP_TO_ORDER);
 
	return AIOrder::SkipToOrder(vehicle_id, order_position);
 
}
 

	
 
/* static */ bool AIVehicle::ReverseVehicle(VehicleID vehicle_id)
 
{
 
	EnforcePrecondition(false, IsValidVehicle(vehicle_id));
 
	EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_ROAD || ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN);
 

	
 
	switch (::Vehicle::Get(vehicle_id)->type) {
 
		case VEH_ROAD: return AIObject::DoCommand(0, vehicle_id, 0, CMD_TURN_ROADVEH);
 
		case VEH_TRAIN: return AIObject::DoCommand(0, vehicle_id, 0, CMD_REVERSE_TRAIN_DIRECTION);
 
		default: NOT_REACHED();
 
	}