2008-03-30 23:24:18 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00: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-30 23:24:18 +00: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 10:18:19 +00:00
|
|
|
#include "company_type.h"
|
2008-03-30 23:24:18 +00:00
|
|
|
|
|
|
|
/* Functions */
|
|
|
|
void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination);
|
2008-09-24 16:40:06 +00:00
|
|
|
void InvalidateVehicleOrder(const Vehicle *v, int data);
|
2008-03-30 23:24:18 +00:00
|
|
|
void CheckOrders(const Vehicle*);
|
2011-02-09 21:40:32 +00:00
|
|
|
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist = false, bool reset_order_indices = true);
|
2008-04-05 10:55:50 +00:00
|
|
|
bool ProcessOrders(Vehicle *v);
|
2011-06-14 19:19:13 +00:00
|
|
|
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth = 0, bool pbs_look_ahead = false);
|
2008-08-02 22:53:05 +00:00
|
|
|
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
|
2011-12-13 00:43:48 +00:00
|
|
|
uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth = 0);
|
2008-03-30 23:24:18 +00:00
|
|
|
|
2009-11-28 15:12:24 +00: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 12:40:09 +00:00
|
|
|
|
2008-03-30 23:24:18 +00:00
|
|
|
#define MIN_SERVINT_PERCENT 5
|
|
|
|
#define MAX_SERVINT_PERCENT 90
|
|
|
|
#define MIN_SERVINT_DAYS 30
|
|
|
|
#define MAX_SERVINT_DAYS 800
|
|
|
|
|
2013-02-14 17:06:49 +00:00
|
|
|
uint16 GetServiceIntervalClamped(uint interval, bool ispercent);
|
2008-03-30 23:24:18 +00:00
|
|
|
|
|
|
|
#endif /* ORDER_FUNC_H */
|