Skip to main content

find_material_storage

Function find_material_storage 

Source
pub fn find_material_storage(
    sites: &[StorageSite],
    storages: &[Storage],
    materials: &[RawMaterial],
    material: usize,
    count: i32,
    put: bool,
    cell: i32,
    exclude: Option<usize>,
    map: &mut impl StorageSearchMap,
    rng: &mut Random,
) -> Option<StorageMatch>
Expand description

The storage nearest cell (entrance path rank) that holds count of material (put false) or can take them (put true). Ordinary storages, then markets; exclude is skipped. A StorageLocation must accept the material’s flags. On a strict entrance-rank improvement the target point (slot scan, or a market use point) must exist with its own rank below the best, and the best becomes the entrance rank.

Original: FUN_140092a60.