private static void Visit(HashSet <ConstellationPart> visited, ConstellationPart point) { if (visited.Contains(point)) { return; } visited.Add(point); foreach (ConstellationPart connection in point.connections) { Visit(visited, connection); } }
public int CalcDistance(ConstellationPart otherPoint) { return(Math.Abs(otherPoint.x - x) + Math.Abs(otherPoint.y - y) + Math.Abs(otherPoint.z - z) + Math.Abs(otherPoint.t - t)); }