function getDistanceFromRoot(engine) {
  let distance = 0;
  let curr = engine;

  while (curr !== engine.project) {
    distance++;
    curr = curr.parent;
  }

  return distance;
}
Gets the level of the engine node or the total distance
from the root

@name getDistanceFromRoot
@param {EngineAddon} engine The engine
@returns {number} The distance