OpenTTD
order_func.h
Go to the documentation of this file.
1 /* $Id: order_func.h 24995 2013-02-14 17:06:49Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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  */
9 
12 #ifndef ORDER_FUNC_H
13 #define ORDER_FUNC_H
14 
15 #include "order_type.h"
16 #include "vehicle_type.h"
17 #include "company_type.h"
18 
19 /* Functions */
20 void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination);
21 void InvalidateVehicleOrder(const Vehicle *v, int data);
22 void CheckOrders(const Vehicle*);
23 void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist = false, bool reset_order_indices = true);
24 bool ProcessOrders(Vehicle *v);
25 bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth = 0, bool pbs_look_ahead = false);
26 VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
27 uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth = 0);
28 
29 void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int left, int middle, int right);
30 
31 #define MIN_SERVINT_PERCENT 5
32 #define MAX_SERVINT_PERCENT 90
33 #define MIN_SERVINT_DAYS 30
34 #define MAX_SERVINT_DAYS 800
35 
36 uint16 GetServiceIntervalClamped(uint interval, bool ispercent);
37 
38 #endif /* ORDER_FUNC_H */
bool ProcessOrders(Vehicle *v)
Handle the orders of a vehicle and determine the next place to go to if needed.
Definition: order_cmd.cpp:2160
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth=0, bool pbs_look_ahead=false)
Update the vehicle&#39;s destination tile from an order.
Definition: order_cmd.cpp:2039
Types related to orders.
Vehicle data structure.
Definition: vehicle_base.h:212
uint16 GetServiceIntervalClamped(uint interval, bool ispercent)
Clamp the service interval to the correct min/max.
Definition: order_cmd.cpp:1954
uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth=0)
Get the distance between two orders of a vehicle.
Definition: order_cmd.cpp:697
void InvalidateVehicleOrder(const Vehicle *v, int data)
Updates the widgets of a vehicle which contains the order-data.
Definition: order_cmd.cpp:252
OrderType
Order types.
Definition: order_type.h:37
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist=false, bool reset_order_indices=true)
Delete all orders from a vehicle.
Definition: order_cmd.cpp:1925
void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination)
Removes an order from all vehicles.
Definition: order_cmd.cpp:1837
Types related to vehicles.
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v)
Process a conditional order and determine the next order.
Definition: order_cmd.cpp:2010
Types related to companies.
byte VehicleOrderID
The index of an order within its current vehicle (not pool related)
Definition: order_type.h:17
void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int left, int middle, int right)
Draws an order in order or timetable GUI.
Definition: order_gui.cpp:213
void CheckOrders(const Vehicle *)
Check the orders of a vehicle, to see if there are invalid orders and stuff.
Definition: order_cmd.cpp:1762