VehicleControl
Controls for functions related to vehicle
GetLoadableResources
public override List<Resource> GetLoadableResources(Product product, Vehicle vehicle)
Definition
Returns a list of resources in the corresponding vehicle that can handle the product.
Parameters
Type
Description
Product
The product object.
Vehicle
The vehicle object.
Return
Type
Description
Default
Example (Default Logic)
public override List<Resource> GetLoadableResources(Product product, Vehicle vehicle)
{
List<Resource> list = new List<Resource>();
foreach (KeyValuePair<string, Resource> item in vehicle.Resources)
{
Resource res = item.Value;
if (res.Product.ID != product.ID)
continue;
list.Add(res);
}
return list;
}
Last updated