(svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
/* $Id$ */
/** @file ai_vehiclelist.cpp List of vehicles */
#include "ai_vehiclelist.hpp"
#include "ai_station.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);
}
}
AIVehicleList_Station::AIVehicleList_Station(StationID station_id)
{
if (!AIStation::IsValidStation(station_id)) return;
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_id) {
this->AddItem(v->index);
break;
}
}
}
}
}