Click or drag to resize

ConfigAccessorGetValueByPathT Method (ConfigNode, String, T, AbstractOrdinaryValueTypeProto)

Reads a value of arbitrary type T from a 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 bool GetValueByPath<T>(
	ConfigNode node,
	string[] pathKeys,
	ref T value,
	AbstractOrdinaryValueTypeProto typeProto = null
)
Request Example View Source

Parameters

node
Type: (Default Namespace)ConfigNode
A node to read data from.
pathKeys
Type: SystemString
An array of values that makes the full path. First node in the array is the top most component of the path.
value
Type: T
A variable to read value into. The typeProto handler must know how to convert value's type from string.
typeProto (Optional)
Type: KSPDev.ConfigUtilsAbstractOrdinaryValueTypeProto
A proto capable to handle the type of value. If not set then StandardOrdinaryTypesProto is used.

Type Parameters

T
The value type to read. Type proto must be able to handle it.

Return Value

Type: Boolean
true if value was successfully read and stored.
Exceptions
ExceptionCondition
ArgumentExceptionIf type cannot be handled by the proto.
See Also