kOS.Suffixed.Node.AddToVessel C# (CSharp) Method

AddToVessel() public method

public AddToVessel ( Vessel v ) : void
v Vessel
return void
        public void AddToVessel(Vessel v)
        {
            if (nodeRef != null) throw new Exception("Node has already been added");

            string careerReason;
            if (! Career.CanMakeNodes(out careerReason))
                throw new KOSLowTechException("use maneuver nodes", careerReason);

            vesselRef = v;

            if (v.patchedConicSolver == null)
                throw new KOSSituationallyInvalidException(
                    "A KSP limitation makes it impossible to access the manuever nodes of this vessel at this time. " +
                    "(perhaps it's not the active vessel?)");

            nodeRef = v.patchedConicSolver.AddManeuverNode(time);

            UpdateNodeDeltaV();

            v.patchedConicSolver.UpdateFlightPlan();

            nodeLookup.Add(nodeRef, this);
        }