You can check each industry with function like this one:Kilinich wrote: How can I get list of industries which accepts particular cargo?
Code: Select all
function IsIndustryAcceptingParticularCargo(industry_id, cargo_id)
{
local r = AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP);
if(!AIIndustry.IsValidIndustry(industry_id))
return false;
if(!AICargo.IsValidCargo(cargo_id))
return false;
if(AITile.GetCargoAcceptance(AIIndustry.GetLocation(industry_id), cargo_id, 1, 1, r)>=8)
return true;
return false;
}
I think it's also possible to wtrite AIIndustryList valuator.
I wrote some (Get Cargo, Capacity, Speed) but have some problems with SVN (my linux machine will never has internet access, unfortunately I do not know how to make SVN work without it ) and so can not provide patch with theese functionsKilinich wrote: I think we need some more:
new AIEngine class with functions like this:
char * GetEngineName (EngineID engine_id)
cargo_id GetEngineCargo (EngineID engine_id)
uint32 GetEngineCapacity (EngineID engine_id)
uint32 GetEngineReliability (EngineID engine_id)
uint32 GetEngineMaxSpeed (EngineID engine_id)
bool IsValidEngine (EngineID engine_id)