pub fn with_pillars<F>(chunk_index: ChunkIndex, mut func: F) -> Chunk
    where
        F: FnMut(AxialPoint) -> HexPillar,
    {
        let mut hec = Vec::new();
        let start_q = CHUNK_SIZE as i32 * chunk_index.0.q;
        let start_r = CHUNK_SIZE as i32 * chunk_index.0.r;

        for r in start_r..start_r + CHUNK_SIZE as i32 {
            for q in start_q..start_q + CHUNK_SIZE as i32 {
                let pos = AxialPoint::new(q, r);
                hec.push(func(pos));
            }
        }
        Chunk { pillars: hec }
    }
/// Creates a `Chunk` using individual pillars returned by a closure
Creates a `Chunk` using individual pillars returned by a closure
Creates a ` Chunk ` using individual pillars returned by a closure
pub fn with_pillars<F>(chunk_index: ChunkIndex, mut func: F) -> Chunk
    where
        F: FnMut(AxialPoint) -> HexPillar,
    {
        let mut hec = Vec::new();
        let start_q = CHUNK_SIZE as i32 * chunk_index.0.q;
        let start_r = CHUNK_SIZE as i32 * chunk_index.0.r;
        for r in start_r..start_r + CHUNK_SIZE as i32 {
            for q in start_q..start_q + CHUNK_SIZE as i32 {
                let pos = AxialPoint::new(q, r);
                hec.push(func(pos));
            }
        }
        Chunk { pillars: hec }
    }
pub fn with_pillars < F > ( chunk_index : ChunkIndex , mut func : F ) -> Chunk where F : FnMut ( AxialPoint ) -> HexPillar , { let mut hec = Vec :: new ( ) ; let start_q = CHUNK_SIZE as i32 * chunk_index . 0 . q ; let start_r = CHUNK_SIZE as i32 * chunk_index . 0 . r ; for r in start_r .. start_r + CHUNK_SIZE as i32 { for q in start_q .. start_q + CHUNK_SIZE as i32 { let pos = AxialPoint :: new ( q , r ) ; hec . push ( func ( pos ) ) ; } } Chunk { pillars : hec } }
Creates a `Chunk` using individual pillars returned by a closure
Creates a ` Chunk ` using individual pillars returned by a closure
chunk_index
ChunkIndex
func
F