kOS.Binding.FlightControlManager.GetControllerByVessel C# (CSharp) Method

GetControllerByVessel() public static method

public static GetControllerByVessel ( Vessel target ) : FlightControl
target Vessel
return FlightControl
        public static FlightControl GetControllerByVessel(Vessel target)
        {
            FlightControl flightControl;
            if (!flightControls.TryGetValue(target.rootPart.flightID, out flightControl))
            {
                flightControl = new FlightControl(target);
                flightControls.Add(target.rootPart.flightID, flightControl);
            }

            if (flightControl.Vessel == null)
                flightControl.UpdateVessel(target);

            return flightControl;
        }