Main

Updated for version 4.0 Utilities are useful functions for bunch of purposes.

BeardLib.Utils class

The main utilities class

Functions

Get

Other

json class

Existing class added by BLT. BeardLib adds a special encoding and decoding function that add support for these values: Vector3, Color, Rotation, and callback.

This class uses periods and not a colon for function calls; so you'd call it like: json.func().

Functions

Anonymous functions

Functions

Examples

CheckParamsValidity

BeardLib.Utils:CheckParamsValidity({x, y}, {
    func_name = "MyCoolClass:init", 
    params = {{type="string", allow_nil = false}, {type="number", allow_nil = true}}
}))

This function checks if x is a string and not null (allow_nil defaults to false but for this example I wrote it) and checks if y is a number but allows it to be a null.

GetSubValues

BeardLib.Utils:GetSubValues({
    {test = false, test2 = "this wont come through"}, 
    {test = true, test3 = "this also wont come through"}
}, "test")

Returns:

{[1] = false, [2] = true}

Last updated