// small helper function OrbitNode FindOrCreateNode(string id) { if (!nodes.TryGetValue(id, out OrbitNode node)) { return(nodes[id] = new OrbitNode(id)); } return(node); }
// 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); }
public OrbitNode(OrbitNode copyMe) : base(copyMe) { }