예제 #1
0
        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);
            }
        }
예제 #2
0
 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));
 }