The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

int lua_rng::impl_rng_create ( lua_State L)

Implementations for lua callbacks.

Definition at line 37 of file lua_rng.cpp.

References lua_newuserdata(), and luaL_setmetatable().

Referenced by load_tables().

int lua_rng::impl_rng_destroy ( lua_State L)

Definition at line 46 of file lua_rng.cpp.

References d, ERR_LUA, lua_error(), lua_pushstring(), lua_type(), lua_typename(), and luaL_testudata().

Referenced by load_tables().

int lua_rng::impl_rng_draw ( lua_State L)

Definition at line 69 of file lua_rng.cpp.

References rand_rng::mt_rng::get_next_random(), lua_pushnumber(), and luaL_checkudata().

Referenced by load_tables().

int lua_rng::impl_rng_seed ( lua_State L)

Definition at line 60 of file lua_rng.cpp.

References luaL_checkstring, luaL_checkudata(), and rand_rng::mt_rng::seed_random().

Referenced by 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(), lua_pushvalue(), lua_setfield(), lua_setglobal(), luaL_newmetatable(), and luaL_setfuncs().

Referenced by lua_kernel_base::lua_kernel_base().

Variable Documentation

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

Definition at line 35 of file lua_rng.cpp.