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

TypeDescription

Product

The product object.

Vehicle

The vehicle object.

Return

TypeDescriptionDefault

List<Resource>

A list of resources that can be processed.

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