C# Класс kOS.Module.kOSVesselModule

The kOSVesselModule class contains references to anything that is vessel specific rather than processor part specific. For instance, flight controls and steering. It gives a single location to manage instances where docking, staging, and similar events should be handled automatically.
Наследование: VesselModule
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddFlightControlParameter ( string name, IFlightControlParameter parameter ) : void

Adds an IFlightControlParameter to the reference dictionary, and throws an error if it already exists.

FixedUpdate ( ) : void

FixedUpdate is called once per physics tick.

GetFlightControlParameter ( string name ) : IFlightControlParameter

Returns the named IFlightControlParameter

GetInstance ( Vessel vessel ) : kOSVesselModule

Return the kOSVesselModule instance associated with the given Vessel object

HasFlightControlParameter ( string name ) : bool

Returns true if the named IFlightControlParameter already exists

LastUpdate ( ) : void

LastUpdate is called at the end of the update frame. Useful if something needs to be done after the physics and UI updates have been completed, but before scene or gui rendering.

OnDestroy ( ) : void

OnDestroy is called when the Vessel object is destroyed. This is the last method called by KSP. We can remove the instance tracking and unhook events here.

OnGUI ( ) : void

OnGUI is where any vessel specific interface rendering should be done.

RemoveFlightControlParameter ( string name ) : void

Removes the named IFlightControlParameter from the reference dictionary.

Update ( ) : void

Update is called once per UI tick.

Защищенные методы

Метод Описание
OnAwake ( ) : void

OnAwake is called once when instatiating a new VesselModule. This is the first method called by KSP after the VesselModule has been attached to the parent Vessel. We use it to store the parent Vessel and track the kOSVesselModule instances.

OnLoad ( ConfigNode node ) : void
OnStart ( ) : void

Start is called after OnEnable activates the module. This is the second method called by KSP after Awake. All parts should be added to the vessel now, so it is safe to walk the parts tree to find the attached kOSProcessor modules.

Приватные методы

Метод Описание
AddDefaultParameters ( ) : void

Setup the default flight parameters.

CheckRehookAutopilot ( ) : void

A race condition exists where KSP can load the kOS module onto the vessel before it loaded the RemoteTech module. That makes it so that kOS may not see the existence of RT yet when kOS is first initialized.

This fixes that case by continually re-querying for RT post-loading, and re-initializing kOS's RT-related behaviors if it seems that the RT module now exists when it didn't before (or visa versa).
With the update for KSP 1.2, this function was renamed and made more generic so that it may support future autopilot connectivity configurations.

ClearParts ( ) : void

Clear the childParts list. This is used when refreshing the parts list, or when destroying the module.

HandleOnPreAutopilotUpdate ( FlightCtrlState c ) : void
HandleRemoteTechSanctionedPilot ( FlightCtrlState c ) : void
HarvestParts ( ) : void

Generates a list of all processorModules included on the parentVessel.

HookEvents ( ) : void

Hook up to any vessel/game events that might be needed.

UnHookEvents ( ) : void

Unhook from events we previously hooked up to.

UpdateAutopilot ( FlightCtrlState c ) : void

Call to each IFlightControlParameter to update the flight controls. This is called during OnPreAutopilotUpdate

UpdateParameterState ( ) : void

Update the current stte of the each IFlightControlParameter. This is called during FixedUpdate

cacheControllable ( ) : void
resetControllable ( ) : void

Описание методов

AddFlightControlParameter() публичный Метод

Adds an IFlightControlParameter to the reference dictionary, and throws an error if it already exists.
public AddFlightControlParameter ( string name, IFlightControlParameter parameter ) : void
name string the bound name of the parameter, this will be converted to lower case internally
parameter IFlightControlParameter
Результат void

FixedUpdate() публичный Метод

FixedUpdate is called once per physics tick.
public FixedUpdate ( ) : void
Результат void

GetFlightControlParameter() публичный Метод

Returns the named IFlightControlParameter
public GetFlightControlParameter ( string name ) : IFlightControlParameter
name string the bound name of the parameter, this will be converted to lower case internally
Результат IFlightControlParameter

GetInstance() публичный статический Метод

Return the kOSVesselModule instance associated with the given Vessel object
public static GetInstance ( Vessel vessel ) : kOSVesselModule
vessel Vessel the vessel for which the module should be returned
Результат kOSVesselModule

HasFlightControlParameter() публичный Метод

Returns true if the named IFlightControlParameter already exists
public HasFlightControlParameter ( string name ) : bool
name string the bound name of the parameter, this will be converted to lower case internally
Результат bool

LastUpdate() публичный Метод

LastUpdate is called at the end of the update frame. Useful if something needs to be done after the physics and UI updates have been completed, but before scene or gui rendering.
public LastUpdate ( ) : void
Результат void

OnAwake() защищенный Метод

OnAwake is called once when instatiating a new VesselModule. This is the first method called by KSP after the VesselModule has been attached to the parent Vessel. We use it to store the parent Vessel and track the kOSVesselModule instances.
protected OnAwake ( ) : void
Результат void

OnDestroy() публичный Метод

OnDestroy is called when the Vessel object is destroyed. This is the last method called by KSP. We can remove the instance tracking and unhook events here.
public OnDestroy ( ) : void
Результат void

OnGUI() публичный Метод

OnGUI is where any vessel specific interface rendering should be done.
public OnGUI ( ) : void
Результат void

OnLoad() защищенный Метод

protected OnLoad ( ConfigNode node ) : void
node System.ConfigNode
Результат void

OnStart() защищенный Метод

Start is called after OnEnable activates the module. This is the second method called by KSP after Awake. All parts should be added to the vessel now, so it is safe to walk the parts tree to find the attached kOSProcessor modules.
protected OnStart ( ) : void
Результат void

RemoveFlightControlParameter() публичный Метод

Removes the named IFlightControlParameter from the reference dictionary.
public RemoveFlightControlParameter ( string name ) : void
name string the bound name of the parameter, this will be converted to lower case internally
Результат void

Update() публичный Метод

Update is called once per UI tick.
public Update ( ) : void
Результат void