Class KVObjectExtensions
- Assembly
- ValveResourceFormat.dll
Extension methods for KVObject.
public static class KVObjectExtensions
Inheritance
Inherited Members
Methods
GetArray<T>(KVObject, string, Func<KVObject, T>)
Gets an array from the key-value object and maps each element.
public static T[] GetArray<T>(this KVObject collection, string name, Func<KVObject, T> mapper)
Parameters
Returns
- T[]
Type Parameters
T
GetArray(KVObject, string)
Gets an array of KVObjects from the key-value object.
public static KVObject[] GetArray(this KVObject collection, string name)
Parameters
Returns
- KVObject[]
GetByteProperty(KVObject, string)
Gets a byte property from the key-value object.
public static byte GetByteProperty(this KVObject collection, string name)
Parameters
Returns
GetDoubleProperty(KVObject, string)
Gets a double property from the key-value object.
public static double GetDoubleProperty(this KVObject collection, string name)
Parameters
Returns
GetEnumValue<TEnum>(KVObject, string, bool, string)
Gets an enum value from the key-value object.
public static TEnum GetEnumValue<TEnum>(this KVObject collection, string name, bool normalize = false, string stripExtension = "Flags") where TEnum : Enum
Parameters
Returns
- TEnum
Type Parameters
TEnum
GetFloatArray(KVObject, string)
Gets a float array from the key-value object.
public static float[] GetFloatArray(this KVObject collection, string name)
Parameters
Returns
- float[]
GetFloatProperty(KVObject, string)
Gets a float property from the key-value object.
public static float GetFloatProperty(this KVObject collection, string name)
Parameters
Returns
GetInt32Property(KVObject, string)
Gets an Int32 property from the key-value object.
public static int GetInt32Property(this KVObject collection, string name)
Parameters
Returns
GetIntegerArray(KVObject, string)
Gets an integer array from the key-value object.
public static long[] GetIntegerArray(this KVObject collection, string name)
Parameters
Returns
- long[]
GetIntegerProperty(KVObject, string)
Gets an integer property from the key-value object.
public static long GetIntegerProperty(this KVObject collection, string name)
Parameters
Returns
GetStringProperty(KVObject, string)
Gets a string property from the key-value object.
public static string GetStringProperty(this KVObject collection, string name)
Parameters
Returns
GetSubCollection(KVObject, string)
Gets a sub-collection from the key-value object.
public static KVObject GetSubCollection(this KVObject collection, string name)
Parameters
Returns
GetUInt32Property(KVObject, string)
Gets a UInt32 property from the key-value object.
public static uint GetUInt32Property(this KVObject collection, string name)
Parameters
Returns
GetUnsignedIntegerArray(KVObject, string)
Gets an unsigned integer array from the key-value object.
public static ulong[] GetUnsignedIntegerArray(this KVObject collection, string name)
Parameters
Returns
- ulong[]
GetUnsignedIntegerProperty(KVObject, string)
Gets an unsigned integer property from the key-value object.
public static ulong GetUnsignedIntegerProperty(this KVObject collection, string name)
Parameters
Returns
IsNotBlobType(KVObject, string)
Determines whether the specified key contains an array (not a blob type).
public static bool IsNotBlobType(this KVObject collection, string key)
Parameters
Returns
NormalizeEnumName<TEnum>(string, string)
Normalize C Style VALVE_ENUM_VALUE_1 to C# ValveEnum.Value1
public static string NormalizeEnumName<TEnum>(string name, string stripExtension = "") where TEnum : Enum
Parameters
Returns
Type Parameters
TEnum
ToMatrix4x4(KVObject[])
Converts an array of key-value objects to a Matrix4x4.
public static Matrix4x4 ToMatrix4x4(this KVObject[] array)
Parameters
array
KVObject[]
Returns
ToMatrix4x4(KVObject)
Converts the key-value object to a Matrix4x4.
public static Matrix4x4 ToMatrix4x4(this KVObject array)
Parameters
array
KVObject
Returns
ToQuaternion(KVObject)
Converts the key-value object to a Quaternion.
public static Quaternion ToQuaternion(this KVObject collection)
Parameters
collection
KVObject
Returns
ToVector2(KVObject)
Converts the key-value object to a Vector2.
public static Vector2 ToVector2(this KVObject collection)
Parameters
collection
KVObject
Returns
ToVector3(KVObject)
Converts the key-value object to a Vector3.
public static Vector3 ToVector3(this KVObject collection)
Parameters
collection
KVObject
Returns
ToVector4(KVObject)
Converts the key-value object to a Vector4.
public static Vector4 ToVector4(this KVObject collection)
Parameters
collection
KVObject