2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
8 /** @file order_func.h Functions related to orders. */
13 #include "order_type.h"
14 #include "vehicle_type.h"
15 #include "company_type.h"
18 void RemoveOrderFromAllVehicles(OrderType type
, DestinationID destination
, bool hangar
= false);
19 void InvalidateVehicleOrder(const Vehicle
*v
, int data
);
20 void CheckOrders(const Vehicle
*);
21 void DeleteVehicleOrders(Vehicle
*v
, bool keep_orderlist
= false, bool reset_order_indices
= true);
22 bool ProcessOrders(Vehicle
*v
);
23 bool UpdateOrderDest(Vehicle
*v
, const Order
*order
, int conditional_depth
= 0, bool pbs_look_ahead
= false);
24 VehicleOrderID
ProcessConditionalOrder(const Order
*order
, const Vehicle
*v
);
25 uint
GetOrderDistance(const Order
*prev
, const Order
*cur
, const Vehicle
*v
, int conditional_depth
= 0);
27 void DrawOrderString(const Vehicle
*v
, const Order
*order
, int order_index
, int y
, bool selected
, bool timetable
, int left
, int middle
, int right
);
29 static const uint DEF_SERVINT_DAYS_TRAINS
= 150;
30 static const uint DEF_SERVINT_DAYS_ROADVEH
= 150;
31 static const uint DEF_SERVINT_DAYS_AIRCRAFT
= 100;
32 static const uint DEF_SERVINT_DAYS_SHIPS
= 360;
33 static const uint MIN_SERVINT_DAYS
= 30;
34 static const uint MAX_SERVINT_DAYS
= 800;
36 static const uint DEF_SERVINT_MINUTES_TRAINS
= 5;
37 static const uint DEF_SERVINT_MINUTES_ROADVEH
= 5;
38 static const uint DEF_SERVINT_MINUTES_AIRCRAFT
= 3;
39 static const uint DEF_SERVINT_MINUTES_SHIPS
= 12;
40 static const uint MIN_SERVINT_MINUTES
= 1;
41 static const uint MAX_SERVINT_MINUTES
= 30;
43 static const uint DEF_SERVINT_PERCENT
= 50;
44 static const uint MIN_SERVINT_PERCENT
= 5;
45 static const uint MAX_SERVINT_PERCENT
= 90;
47 uint16_t GetServiceIntervalClamped(int interval
, bool ispercent
);
49 #endif /* ORDER_FUNC_H */