micropolis-rs icon indicating copy to clipboard operation
micropolis-rs copied to clipboard

Core+WASM: Provide a public and fully-fledged CityBuilder to the WASM interface

Open pierreyoda opened this issue 3 years ago • 0 comments

Following the builder pattern, provide a new CityBuilder facility accessible from the WASM interface.

Proposed interface

let mut city_generator = CityGeneratorBuilder::new()
    .set_map_generator_options(/* ... */)
    .set_simulation_rng_seed(123456)
    .build()?;
let map1 = city_generator.build_random_map(1234)?;
let map2 = city_generator.build_random_map(4567)?;
let city = city_generator.generate(GameLevelDifficulty::Normal, map1)?;

pierreyoda avatar Aug 07 '21 13:08 pierreyoda