rust/lib-hwengine-future/src/lib.rs
changeset 16058 de01be16df95
parent 16053 85d7d6b71087
child 16062 288df7b85efc
equal deleted inserted replaced
16057:106674bb21b1 16058:de01be16df95
   106         fs::read_to_string(data_path.join(Path::new("wfc_templates.yaml")).as_path())
   106         fs::read_to_string(data_path.join(Path::new("wfc_templates.yaml")).as_path())
   107             .expect("Error reading map templates file");
   107             .expect("Error reading map templates file");
   108     let mut map_gen = MapGenerator::<WfcTemplate>::new(data_path);
   108     let mut map_gen = MapGenerator::<WfcTemplate>::new(data_path);
   109     map_gen.import_yaml_templates(&yaml_templates);
   109     map_gen.import_yaml_templates(&yaml_templates);
   110 
   110 
   111     let distance_divisor = feature_size.pow(2) / 8 + 10;
   111     let params = LandGenerationParameters::new(0u16, 0x8000u16, feature_size, false, false);
   112     let params = LandGenerationParameters::new(0u16, 0x8000u16, distance_divisor, false, false);
       
   113     let template = map_gen
   112     let template = map_gen
   114         .get_template(template_type, &mut random_numbers_gen)
   113         .get_template(template_type, &mut random_numbers_gen)
   115         .expect("Error reading wfc templates file")
   114         .expect("Error reading wfc templates file")
   116         .clone();
   115         .clone();
   117     let landgen = map_gen.build_generator(template);
   116     let landgen = map_gen.build_generator(template);