ConfigAccessorGetValueByPathT Method (ConfigNode, String, AbstractOrdinaryValueTypeProto) |
Reads a value of an arbitrary type T from the config node.
Namespace:
KSPDev.ConfigUtils
Assembly:
KSPDev_Utils.2.0 (in KSPDev_Utils.2.0.dll) Version: 2.0 for KSP v1.8+
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: 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:
NullableTThe parsed value or
null if not found.
ExceptionsException | Condition |
---|
ArgumentException | If type cannot be handled by the proto. |
See Also