gridmap 0.0.2

library for handling infinite multi-dimensional grids of cells
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Utility functions

use crate::{Chunk, cell::Cell};
use ndarray::{Dim, Dimension, Ix};

/// Return true if the provided chunk contains only null cells
pub(crate) fn is_chunk_empty<A, const D: usize>(chunk: &Chunk<A, D>) -> bool
where
    A: Cell,
    Dim<[Ix; D]>: Dimension,
{
    for cell in chunk.iter() {
        if !cell.is_null() {
            return false;
        }
    }
    true
}