ConfigAccessorGetValueByPathT Method (ConfigNode, String, T, AbstractOrdinaryValueTypeProto) |
Reads a value of arbitrary type T from a 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 bool GetValueByPath<T>(
ConfigNode node,
string[] pathKeys,
ref T value,
AbstractOrdinaryValueTypeProto typeProto = null
)
Request Example
View SourceParameters
- 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:
Booleantrue if value was successfully read and stored.
ExceptionsException | Condition |
---|
ArgumentException | If type cannot be handled by the proto. |
See Also