(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
#include "ai_vehiclelist.hpp"
#include "../../player.h"
#include "../../station.h"
#include "../../vehicle.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;
}
}
}
}
}