From 055fa3aa3cc8dac80b2e7fb5df26142cbd464110 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Mon, 6 Dec 2021 16:37:32 +0200 Subject: [PATCH] Added N+E+S+W and ALL constants in NDirections --- IDAstar.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IDAstar.cs b/IDAstar.cs index 697ba89..aa99542 100644 --- a/IDAstar.cs +++ b/IDAstar.cs @@ -61,9 +61,13 @@ namespace IdaStar SE = 0b0010_0000, SW = 0b0100_0000, NW = 0b1000_0000, + + N_E_S_W = 0b0000_1111, + ALL = 0b1111_1111, } - public List GetNeighbours(byte directions = 0b1111) { + public List GetNeighbours(NDirections directions = NDirections.N_E_S_W) => GetNeighbours((byte)directions); + public List GetNeighbours(byte directions) { List result = new(); if ((directions & ((byte)NDirections.N)) > 0) {