Skip to main content

RandomSampler

Functions

new

RandomSampler.new(
samples{T}--

The list of samples to sample from

) → RandomSampler<T>

Constructs a new RandomSampler

SetSamples

RandomSampler.SetSamples(
selfRandomSampler<T>,
samples{T}--

The list of samples to sample from

) → ()

Sets the samples to sample from

Sample

RandomSampler.Sample(selfRandomSampler<T>) → T--

The sample

Samples from the list

Refill

RandomSampler.Refill(selfRandomSampler<T>) → ()

Refills the list

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new RandomSampler",
            "params": [
                {
                    "name": "samples",
                    "desc": "The list of samples to sample from",
                    "lua_type": "{ T }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RandomSampler<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 29,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        },
        {
            "name": "SetSamples",
            "desc": "Sets the samples to sample from",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "RandomSampler<T>"
                },
                {
                    "name": "samples",
                    "desc": "The list of samples to sample from",
                    "lua_type": "{ T }"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 48,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        },
        {
            "name": "Sample",
            "desc": "Samples from the list",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "RandomSampler<T>"
                }
            ],
            "returns": [
                {
                    "desc": "The sample",
                    "lua_type": "T"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 64,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        },
        {
            "name": "Refill",
            "desc": "Refills the list",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "RandomSampler<T>"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 78,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RandomSampler",
    "desc": "",
    "source": {
        "line": 5,
        "path": "src/randomutils/src/Shared/RandomSampler.lua"
    }
}