2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-03-31 01:24:18 +02:00
|
|
|
/** @file order_func.h Functions related to orders. */
|
|
|
|
|
|
|
|
#ifndef ORDER_FUNC_H
|
|
|
|
#define ORDER_FUNC_H
|
|
|
|
|
|
|
|
#include "order_type.h"
|
|
|
|
#include "vehicle_type.h"
|
2009-07-22 12:18:19 +02:00
|
|
|
#include "company_type.h"
|
2008-03-31 01:24:18 +02:00
|
|
|
|
|
|
|
/* Functions */
|
2018-10-01 17:01:28 +02:00
|
|
|
void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination, bool hangar = false);
|
2008-09-24 18:40:06 +02:00
|
|
|
void InvalidateVehicleOrder(const Vehicle *v, int data);
|
2008-03-31 01:24:18 +02:00
|
|
|
void CheckOrders(const Vehicle*);
|
2011-02-09 22:40:32 +01:00
|
|
|
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist = false, bool reset_order_indices = true);
|
2008-04-05 12:55:50 +02:00
|
|
|
bool ProcessOrders(Vehicle *v);
|
2011-06-14 21:19:13 +02:00
|
|
|
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth = 0, bool pbs_look_ahead = false);
|
2008-08-03 00:53:05 +02:00
|
|
|
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
|
2011-12-13 01:43:48 +01:00
|
|
|
uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth = 0);
|
2008-03-31 01:24:18 +02:00
|
|
|
|
2009-11-28 16:12:24 +01:00
|
|
|
void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int left, int middle, int right);
|
2008-04-14 14:40:09 +02:00
|
|
|
|
2023-04-08 20:04:30 +02:00
|
|
|
static const uint DEF_SERVINT_DAYS_TRAINS = 150;
|
|
|
|
static const uint DEF_SERVINT_DAYS_ROADVEH = 150;
|
|
|
|
static const uint DEF_SERVINT_DAYS_AIRCRAFT = 100;
|
|
|
|
static const uint DEF_SERVINT_DAYS_SHIPS = 360;
|
|
|
|
static const uint MIN_SERVINT_DAYS = 30;
|
|
|
|
static const uint MAX_SERVINT_DAYS = 800;
|
|
|
|
|
2024-01-23 17:36:09 +01:00
|
|
|
static const uint DEF_SERVINT_MINUTES_TRAINS = 5;
|
|
|
|
static const uint DEF_SERVINT_MINUTES_ROADVEH = 5;
|
|
|
|
static const uint DEF_SERVINT_MINUTES_AIRCRAFT = 3;
|
|
|
|
static const uint DEF_SERVINT_MINUTES_SHIPS = 12;
|
|
|
|
static const uint MIN_SERVINT_MINUTES = 1;
|
|
|
|
static const uint MAX_SERVINT_MINUTES = 30;
|
|
|
|
|
2023-04-08 20:04:30 +02:00
|
|
|
static const uint DEF_SERVINT_PERCENT = 50;
|
|
|
|
static const uint MIN_SERVINT_PERCENT = 5;
|
|
|
|
static const uint MAX_SERVINT_PERCENT = 90;
|
2008-03-31 01:24:18 +02:00
|
|
|
|
2024-01-10 16:23:36 +01:00
|
|
|
uint16_t GetServiceIntervalClamped(int interval, bool ispercent);
|
2008-03-31 01:24:18 +02:00
|
|
|
|
|
|
|
#endif /* ORDER_FUNC_H */
|