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(
samples{T}--

The list of samples to sample from

) → ()

Sets the samples to sample from

Sample

RandomSampler:Sample() → T--

The sample

Samples from the list

Refill

RandomSampler:Refill() → ()

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": 19,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        },
        {
            "name": "SetSamples",
            "desc": "Sets the samples to sample from",
            "params": [
                {
                    "name": "samples",
                    "desc": "The list of samples to sample from",
                    "lua_type": "{ T }"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 38,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        },
        {
            "name": "Sample",
            "desc": "Samples from the list",
            "params": [],
            "returns": [
                {
                    "desc": "The sample",
                    "lua_type": "T"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 54,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        },
        {
            "name": "Refill",
            "desc": "Refills the list",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 68,
                "path": "src/randomutils/src/Shared/RandomSampler.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RandomSampler",
    "desc": "",
    "source": {
        "line": 4,
        "path": "src/randomutils/src/Shared/RandomSampler.lua"
    }
}