rust/lib-hwengine-future/src/lib.rs
branchtransitional_engine
changeset 16053 3402b2185698
parent 15953 d46ad15c6dec
child 16055 ce4b50823a95
equal deleted inserted replaced
16052:0fd23fc57947 16053:3402b2185698
    62     let mut random_numbers_gen = LaggedFibonacciPRNG::new(seed.as_bytes());
    62     let mut random_numbers_gen = LaggedFibonacciPRNG::new(seed.as_bytes());
    63 
    63 
    64     let yaml_templates =
    64     let yaml_templates =
    65         fs::read_to_string(data_path.join(Path::new("wfc_templates.yaml")).as_path())
    65         fs::read_to_string(data_path.join(Path::new("wfc_templates.yaml")).as_path())
    66             .expect("Error reading map templates file");
    66             .expect("Error reading map templates file");
    67     let mut map_gen = MapGenerator::<WfcTemplate>::new();
    67     let mut map_gen = MapGenerator::<WfcTemplate>::new(data_path);
    68     map_gen.import_yaml_templates(&yaml_templates);
    68     map_gen.import_yaml_templates(&yaml_templates);
    69 
    69 
    70     let distance_divisor = feature_size.pow(2) / 8 + 10;
    70     let distance_divisor = feature_size.pow(2) / 8 + 10;
    71     let params = LandGenerationParameters::new(0u16, 0x8000u16, distance_divisor, false, false);
    71     let params = LandGenerationParameters::new(0u16, 0x8000u16, distance_divisor, false, false);
    72     let template = map_gen
    72     let template = map_gen
    94 ) {
    94 ) {
    95     let data_path: &str = unsafe { CStr::from_ptr(data_path) }.to_str().unwrap();
    95     let data_path: &str = unsafe { CStr::from_ptr(data_path) }.to_str().unwrap();
    96     let data_path = Path::new(&data_path);
    96     let data_path = Path::new(&data_path);
    97 
    97 
    98     let theme_name: &str = unsafe { CStr::from_ptr(theme_name) }.to_str().unwrap();
    98     let theme_name: &str = unsafe { CStr::from_ptr(theme_name) }.to_str().unwrap();
    99     let map_gen = MapGenerator::<()>::new();
    99     let map_gen = MapGenerator::<()>::new(data_path);
   100 
   100 
   101     let theme = Theme::load(
   101     let theme = Theme::load(
   102         data_path
   102         data_path
   103             .join(Path::new("Themes"))
   103             .join(Path::new("Themes"))
   104             .join(Path::new(theme_name))
   104             .join(Path::new(theme_name))