[][src]Trait worldgen::noisemap::NoiseMapGeneratorBase

pub trait NoiseMapGeneratorBase {
    fn generate_chunk(&self, x: i64, y: i64) -> Vec<Vec<f64>>;
fn generate_sized_chunk(&self, size: Size, x: i64, y: i64) -> Vec<Vec<f64>>;
fn id(&self) -> u64; }

Base trait for noise maps. This trait containts functions relevent to the actual map generation, and is all that is required for constraints to generate a world.

NoiseMap, ScaledNoiseMap, and NoiseMapCombination all implement this trait.

Required methods

fn generate_chunk(&self, x: i64, y: i64) -> Vec<Vec<f64>>

Generates a specific chunk of the noise map.

This can be used to generate a larger map in smaller parts.

Example

for y in 0 .. 5 {
    for row in nm.generate_chunk(0, y).iter() {
        for value in row.iter() {
            print!("{}", value);
        }
        println!("");
    }
}

fn generate_sized_chunk(&self, size: Size, x: i64, y: i64) -> Vec<Vec<f64>>

Generate a chunk with a given size instead of the noisemap's size.

This is used when generating a world.

fn id(&self) -> u64

Return the unique id of the noisemap.

Loading content...

Implementors

impl<T1: NoiseMapGenerator, T2: NoiseMapGenerator> NoiseMapGeneratorBase for NoiseMapCombination<T1, T2>[src]

impl<T: NoiseProvider> NoiseMapGeneratorBase for NoiseMap<T>[src]

impl<T: NoiseMapGenerator> NoiseMapGeneratorBase for ScaledNoiseMap<T>[src]

Loading content...