You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenTTD-patches/src/timetable.h

36 lines
1.5 KiB
C++

/*
* 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/>.
*/
/** @file timetable.h Functions related to time tabling. */
#ifndef TIMETABLE_H
#define TIMETABLE_H
#include "date_type.h"
#include "vehicle_type.h"
#include <vector>
#include <tuple>
void ShowTimetableWindow(const Vehicle *v);
void UpdateVehicleTimetable(Vehicle *v, bool travelling);
void SetTimetableParams(int first_param, Ticks ticks, bool long_mode = false);
void SetTimetableWindowsDirty(const Vehicle *v, bool include_scheduled_dispatch = false);
struct TimetableProgress {
VehicleID id;
int order_count;
int order_ticks;
int cumulative_ticks;
bool IsValidForSeparation() const { return this->cumulative_ticks >= 0; }
bool operator<(const TimetableProgress& other) const { return std::tie(this->order_count, this->order_ticks, this->id) < std::tie(other.order_count, other.order_ticks, other.id); }
};
std::vector<TimetableProgress> PopulateSeparationState(const Vehicle *v_start);
#endif /* TIMETABLE_H */