Skip to main content

write_settlements

Function write_settlements 

Source
pub fn write_settlements(
    inputs: &MobileInputs<'_>,
    map_regions: &[MapRegion],
    positions: &[(u16, u16)],
    capitals: &HashMap<usize, u32>,
) -> Result<RecordNode>
Expand description

Writes the settlements list, in map order.

§Arguments

  • inputs - The world, plan and map lookups.
  • map_regions - Regions of the map, in map order.
  • layouts - Settlement layouts of the map.
  • positions - Where the AI places each map region (see super::regions::region_positions).
  • capitals - Component of the faction whose capital each map region is (see super::factions::capitals).

§Errors

Returns an error if the layout lacks the records.