ConfigAccessor.GetValueByPath<T> 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+
Syntaxpublic static Nullable<T> GetValueByPath<T>(
ConfigNode node,
string[] pathKeys,
AbstractOrdinaryValueTypeProto typeProto = null
)
where T : struct, new()
Request Example
View SourceParameters
- node
- Type: (Default Namespace).ConfigNode
The node to read data from. - pathKeys
- Type:System.String[]
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.ConfigUtils.AbstractOrdinaryValueTypeProto
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:
Nullable<T>The parsed value or
null if not found.
Exceptions
See Also