Esempio 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);
 }
Esempio 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);
        }
Esempio n. 3
0
 public OrbitNode(OrbitNode copyMe) : base(copyMe)
 {
 }