pub static EACH_DIRECTION: [Direction; 4]
Expand description

This array contains each direction; it is intended to allow for easy iteration over adjacent locations. The order of the directions is left unspecified and should not be relied upon.

Example

use gridly::prelude::*;
use gridly::shorthand::*;
let root = L(1, 2);
let adjacent: Vec<Location> = EACH_DIRECTION.iter().map(|v| root + v).collect();

assert!(adjacent.contains(&L(0, 2)));
assert!(adjacent.contains(&L(2, 2)));
assert!(adjacent.contains(&L(1, 3)));
assert!(adjacent.contains(&L(1, 1)));
assert_eq!(adjacent.len(), 4);