C# Class RemoteTech.FlightComputer.Commands.ExternalAPICommand

Inheritance: AbstractCommand
Exibir arquivo Open project: RemoteTechnologiesGroup/RemoteTech Class Usage Examples

Public Methods

Method Description
Abort ( ) : void

Aborts the active external command and invokes the ReflectionAbortMethod on the ReflectionType.

Execute ( FlightComputer computer, FlightCtrlState ctrlState ) : bool

Executes this command and invokes the ReflectionExecuteMethod on the ReflectionType. When this command is aborted the fallback commnd is "KillRot".

FromExternal ( ConfigNode externalData ) : ExternalAPICommand

Configures an ExternalAPICommand.

Load ( ConfigNode node, FlightComputer computer ) : bool

Loads the ExternalAPICommand from the persistent file. If the loading can't find the ReflectionType we'll notify a ScreenMessage and remove the command.

Pop ( FlightComputer computer ) : bool

Pops the command and invokes the ReflectionPopMethod on the ReflectionType.

Save ( ConfigNode node, FlightComputer computer ) : void

Saves the original configNode externalData passed from the api to the persistent

Private Methods

Method Description
ConfigNodeToObject ( ExternalAPICommand command, ConfigNode data ) : void

Maps the ConfigNode object passed from the api or loading to an ExternalAPICommand.

callReflectionMember ( string reflectionMember ) : object

Calls the rflection method.

getReflectionType ( string reflectionType ) : Type

Trys to load the reflectionType. Throws an exception if we can't find the type.

prepareDataForExternalMod ( ) : ConfigNode

Prepare the data to pass back to the mod.

Method Details

Abort() public method

Aborts the active external command and invokes the ReflectionAbortMethod on the ReflectionType.
public Abort ( ) : void
return void

Execute() public method

Executes this command and invokes the ReflectionExecuteMethod on the ReflectionType. When this command is aborted the fallback commnd is "KillRot".
public Execute ( FlightComputer computer, FlightCtrlState ctrlState ) : bool
computer FlightComputer Current flightcomputer
ctrlState FlightCtrlState Current FlightCtrlState
return bool

FromExternal() public static method

Configures an ExternalAPICommand.
public static FromExternal ( ConfigNode externalData ) : ExternalAPICommand
externalData System.ConfigNode Data passed by the Api.QueueCommandToFlightComputer
return ExternalAPICommand

Load() public method

Loads the ExternalAPICommand from the persistent file. If the loading can't find the ReflectionType we'll notify a ScreenMessage and remove the command.
public Load ( ConfigNode node, FlightComputer computer ) : bool
node System.ConfigNode Node with the command infos to load
computer FlightComputer Current flightcomputer
return bool

Pop() public method

Pops the command and invokes the ReflectionPopMethod on the ReflectionType.
public Pop ( FlightComputer computer ) : bool
computer FlightComputer Current flightcomputer
return bool

Save() public method

Saves the original configNode externalData passed from the api to the persistent
public Save ( ConfigNode node, FlightComputer computer ) : void
node System.ConfigNode Node with the command infos to save in
computer FlightComputer Current flightcomputer
return void