(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
#include "ai_vehiclelist.hpp"
#include "../../player_func.h"
#include "../../station.h"
#include "../../vehicle_base.h"
AIVehicleList::AIVehicleList()
{
Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (v->owner == _current_player && v->IsPrimaryVehicle()) this->AddItem(v->index);
}
}
AIStationVehicleList::AIStationVehicleList(StationID station)
{
Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (v->owner == _current_player && v->IsPrimaryVehicle()) {
const Order *order;
FOR_VEHICLE_ORDERS(v, order) {
if (order->type == OT_GOTO_STATION && order->dest == station) {
this->AddItem(v->index);
break;
}
}
}
}
}