The Battle for Wesnoth  1.19.4+dev
Functions | Variables
lua_rng Namespace Reference

Functions

int impl_rng_create (lua_State *)
 Implementations for lua callbacks. More...
 
int impl_rng_destroy (lua_State *L)
 
int impl_rng_seed (lua_State *L)
 
int impl_rng_draw (lua_State *L)
 
void load_tables (lua_State *)
 Creates the metatable for RNG objects, and adds the Rng table which contains the constructor. More...
 

Variables

static const char * Rng = "Rng"
 

Function Documentation

◆ impl_rng_create()

int lua_rng::impl_rng_create ( lua_State *  L)

Implementations for lua callbacks.

Definition at line 37 of file lua_rng.cpp.

References Rng.

Referenced by load_tables().

◆ impl_rng_destroy()

int lua_rng::impl_rng_destroy ( lua_State *  L)

Definition at line 46 of file lua_rng.cpp.

References d, ERR_LUA, and Rng.

Referenced by load_tables().

◆ impl_rng_draw()

int lua_rng::impl_rng_draw ( lua_State *  L)

Definition at line 69 of file lua_rng.cpp.

References randomness::mt_rng::get_next_random(), and Rng.

Referenced by load_tables().

◆ impl_rng_seed()

int lua_rng::impl_rng_seed ( lua_State *  L)

Definition at line 60 of file lua_rng.cpp.

References Rng, and randomness::mt_rng::seed_random().

Referenced by load_tables().

◆ load_tables()

void lua_rng::load_tables ( lua_State *  L)

Creates the metatable for RNG objects, and adds the Rng table which contains the constructor.

Definition at line 79 of file lua_rng.cpp.

References impl_rng_create(), impl_rng_destroy(), impl_rng_draw(), impl_rng_seed(), and Rng.

Referenced by lua_kernel_base::lua_kernel_base().

Variable Documentation

◆ Rng

const char* lua_rng::Rng = "Rng"
static