Ejemplo n.º 1
0
 // small helper function
 OrbitNode FindOrCreateNode(string id)
 {
     if (!nodes.TryGetValue(id, out OrbitNode node))
     {
         return(nodes[id] = new OrbitNode(id));
     }
     return(node);
 }
Ejemplo n.º 2
0
        // the Depth of a node is the number of parents it takes to reach the Center of Mass
        private static int Depth(OrbitNode node)
        {
            var depth = 0;

            for (var current = node; !current.IsCenterOfMass; current = current.Parent, depth++)
            {
                ;
            }
            return(depth);
        }
Ejemplo n.º 3
0
 public OrbitNode(OrbitNode copyMe) : base(copyMe)
 {
 }