departures_type.h

Go to the documentation of this file.
00001 /* $Id: departures_type.h $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef DEPARTURES_TYPE_H
00013 #define DEPARTURES_TYPE_H
00014 
00015 #include "station_base.h"
00016 #include "order_base.h"
00017 
00019 typedef enum {
00020   D_TRAVELLING = 0,
00021   D_ARRIVED    = 1,
00022   D_CANCELLED  = 2,
00023 } DepartureStatus;
00024 
00026 typedef enum {
00027   D_DEPARTURE = 0,
00028   D_ARRIVAL   = 1,
00029 } DepartureType;
00030 
00032 typedef struct Departure {
00033   DateTicks scheduled_date;              
00034   DateTicks lateness;                    
00035   StationID terminus;                    
00036   StationID via;                         
00037   SmallVector<StationID, 32> calling_at; 
00038   DepartureStatus status;                
00039   DepartureType type;                    
00040   const Vehicle *vehicle;                
00041   const Order *order;                    
00042   Departure() : terminus(INVALID_STATION), via(INVALID_STATION), calling_at(), vehicle(NULL) { }
00043   ~Departure()
00044   {
00045     calling_at.Reset();
00046   }
00047 } Departure;
00048 
00049 typedef SmallVector<Departure*, 32> DepartureList;
00050 
00051 #endif /* DEPARTURES_TYPE_H */