private static void ExtractConnectionEndFor(Position pos, char[,] artChars, Position.Direction dir, char pointerSymbol, List<PositionedConnection> pointers)
{
int difX = (dir == Position.Direction.East ? 1 : (dir == Position.Direction.West ? -1 : 0));
int difY = (dir == Position.Direction.South ? 1 : (dir == Position.Direction.North ? -1 : 0));
pos.x += difX; pos.y += difY;
if (pos.x < 0 || pos.y < 0 || pos.x >= artChars.GetLength(0) || pos.y >= artChars.GetLength(1))
{
return;
}
if (artChars[pos.x, pos.y] == pointerSymbol)
{
PositionedConnection newConn = new PositionedConnection() { tailDirection = dir };
newConn.track.Add(pos);
pointers.Add(newConn);
}
}