-using System;\r
+\r
+// Uncomment this to disable diagonal movemet.\r
+//#define ALLOW_DIAGONAL_MOVEMENT\r
+\r
+using System;\r
using System.Collections.Generic;\r
using System.Linq;\r
using System.Text;\r
}\r
\r
List<Point> neighbors = new List<Point>(8);\r
+ neighbors.Add(new Point(cell.Point.X, cell.Point.Y - 1));\r
+ neighbors.Add(new Point(cell.Point.X - 1, cell.Point.Y));\r
+ neighbors.Add(new Point(cell.Point.X + 1, cell.Point.Y));\r
+ neighbors.Add(new Point(cell.Point.X, cell.Point.Y + 1));\r
+#if ALLOW_DIAGONAL_MOVEMENT\r
neighbors.Add(new Point(cell.Point.X - 1, cell.Point.Y - 1));\r
- neighbors.Add(new Point(cell.Point.X + 0, cell.Point.Y - 1));\r
neighbors.Add(new Point(cell.Point.X + 1, cell.Point.Y - 1));\r
- neighbors.Add(new Point(cell.Point.X - 1, cell.Point.Y + 0));\r
- neighbors.Add(new Point(cell.Point.X + 1, cell.Point.Y + 0));\r
neighbors.Add(new Point(cell.Point.X - 1, cell.Point.Y + 1));\r
- neighbors.Add(new Point(cell.Point.X + 0, cell.Point.Y + 1));\r
neighbors.Add(new Point(cell.Point.X + 1, cell.Point.Y + 1));\r
+#endif\r
foreach (Point point in neighbors)\r
{\r
Cell inQueue = mCells[point.X, point.Y];\r