rust/landgen/src/lib.rs
author alfadur
Fri, 02 Nov 2018 22:50:45 +0300
changeset 14097 400864ecb954
parent 14069 abb42ba345b6
child 14100 4d22be35cfa2
permissions -rw-r--r--
fix some compile errors

pub mod template_based;
pub mod outline_template;
mod outline;

extern crate integral_geometry;
extern crate land2d;
extern crate itertools;

pub struct LandGenerationParameters<T> {
    zero: T,
    basic: T,
}

impl <T: Copy + PartialEq> LandGenerationParameters<T> {
    pub fn new(zero: T, basic: T) -> Self {
        Self { zero, basic }
    }
}

pub trait LandGenerator {
    fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>(
        &self,
        parameters: LandGenerationParameters<T>,
        random_numbers: &mut I,
    ) -> land2d::Land2D<T>;
}

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }
}