rust/landgen/src/lib.rs
changeset 14100 4d22be35cfa2
parent 14069 abb42ba345b6
child 14121 69db1d2e4cec
equal deleted inserted replaced
14099:7845beb87cb5 14100:4d22be35cfa2
       
     1 mod outline;
       
     2 pub mod outline_template;
     1 pub mod template_based;
     3 pub mod template_based;
     2 pub mod outline_template;
       
     3 mod outline;
       
     4 
     4 
     5 extern crate integral_geometry;
     5 extern crate integral_geometry;
       
     6 extern crate itertools;
     6 extern crate land2d;
     7 extern crate land2d;
     7 extern crate itertools;
       
     8 
     8 
     9 pub struct LandGenerationParameters<T> {
     9 pub struct LandGenerationParameters<T> {
    10     zero: T,
    10     zero: T,
    11     basic: T,
    11     basic: T,
       
    12     distance_divisor: u32,
    12 }
    13 }
    13 
    14 
    14 impl <T: Copy + PartialEq> LandGenerationParameters<T> {
    15 impl<T: Copy + PartialEq> LandGenerationParameters<T> {
    15     pub fn new(zero: T, basic: T) -> Self {
    16     pub fn new(zero: T, basic: T) -> Self {
    16         Self { zero, basic }
    17         Self {
       
    18             zero,
       
    19             basic,
       
    20             distance_divisor: 1,
       
    21         }
    17     }
    22     }
    18 }
    23 }
    19 
    24 
    20 pub trait LandGenerator {
    25 pub trait LandGenerator {
    21     fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>(
    26     fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>(