isStaticNeighbourhood

Tests if something is a StaticNeighbourhood. * returns true if T is a StaticNeighbourhood of dimension N. * A StaticNeighbourhood is a $(NEIGHBOURHOOD) that never changes. If a particular cell has a particular neighbour it will always have that neighbour. Also, if a cell where to have a neighbour "to the right" all other cells will also have a neighbour "to the right". A StaticNeighbourhood dosen't really add any additional functionality. All it does is having the a uint enum NeighboursAmount. *

template isStaticNeighbourhood (
T
uint N
) {
enum isStaticNeighbourhood;
}

Parameters

T

type to be tested

N

number of dimensions *

Return Value

true if T is a StaticNeighbourhood, false if not

Examples

1 struct A {
2 	enum uint Dimension = 2;
3 	enum uint NeighboursAmount = 1;
4 	enum isStatic;
5 	int[2][] getNeighboursCoordinates(int x, int y) {
6 		return [[x+1, y+1]];
7 	}
8 }
9 
10 static assert( isNeighbourhood!(A, 2));
11 static assert( isStaticNeighbourhood!(A, 2));
12 static assert(!isStaticNeighbourhood!(string, 1));

Meta