# vehiclelist.h

Go to the documentation of this file.

    00001 /* $Id$ */
    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 VEHICLELIST_H
    00013 #define VEHICLELIST_H
    00014
    00015 #include "core/smallvec_type.hpp"
    00016 #include "vehicle_type.h"
    00017 #include "company_type.h"
    00018 #include "tile_type.h"
    00019
    00021 enum VehicleListType {
    00022   VL_STANDARD,
    00023   VL_SHARED_ORDERS,
    00024   VL_STATION_LIST,
    00025   VL_DEPOT_LIST,
    00026   VL_GROUP_LIST,
    00027   VLT_END
    00028 };
    00029
    00031 struct VehicleListIdentifier {
    00032   VehicleListType type;
    00033   VehicleType vtype;
    00034   CompanyID company;
    00035   uint32 index;
    00036
    00037   uint32 Pack();
    00038   bool Unpack(uint32 data);
    00039
    00047   VehicleListIdentifier(VehicleListType type, VehicleType vtype, CompanyID company, uint index = 0) :
    00048     type(type), vtype(vtype), company(company), index(index) {}
    00049
    00050   VehicleListIdentifier(uint32 data);
    00051
    00053   VehicleListIdentifier() {}
    00054 };
    00055
    00056 typedef SmallVector<const Vehicle *, 32> VehicleList;
    00057
    00058 bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &identifier);
    00059 void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine_list, VehicleList *wagon_list, bool individual_wagons = false);
    00060
    00061 #endif /* VEHICLELIST_H */