Click or drag to resize

ConfigAccessorGetValueByPathT Method (ConfigNode, String, AbstractOrdinaryValueTypeProto)

Reads a value of an arbitrary type T from the config node.

Namespace:  KSPDev.ConfigUtils
Assembly:  KSPDev_Utils.1.1 (in KSPDev_Utils.1.1.dll) Version: 1.1 for KSP v1.6+
Syntax
C#
public static Nullable<T> GetValueByPath<T>(
	ConfigNode node,
	string[] pathKeys,
	AbstractOrdinaryValueTypeProto typeProto = null
)
where T : struct, new()
Request Example View Source

Parameters

node
Type: (Default Namespace)ConfigNode
The node to read data from.
pathKeys
Type: SystemString
The array of values that makes the full path. The first node in the array is the top most component of the path.
typeProto (Optional)
Type: KSPDev.ConfigUtilsAbstractOrdinaryValueTypeProto
A proto that can parse values of type T. If not set, then StandardOrdinaryTypesProto is used.

Type Parameters

T
The value type to write. The typeProto instance must be able to handle it.

Return Value

Type: NullableT
The parsed value or null if not found.
Exceptions
ExceptionCondition
ArgumentExceptionIf type cannot be handled by the proto.
See Also