The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
lua_rng.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2014 - 2025
3 by Chris Beck <render787@gmail.com>
4 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY.
12
13 See the COPYING file for more details.
14*/
15
16#pragma once
17
18/**
19 * This namespace contains bindings for lua to hold a mt19937 object
20 * as userdata, draw from it, and do the automatic memory management
21 */
22
23struct lua_State;
24
25namespace lua_rng {
26
27/** Implementations for lua callbacks */
28int impl_rng_create(lua_State*);
29int impl_rng_destroy(lua_State*);
30int impl_rng_seed(lua_State*);
31int impl_rng_draw(lua_State*);
32
33/** Creates the metatable for RNG objects, and adds the Rng table which contains the constructor */
34void load_tables(lua_State*);
35
36} // end namespace lua_rng
int impl_rng_create(lua_State *L)
Implementations for lua callbacks.
Definition lua_rng.cpp:38
int impl_rng_draw(lua_State *L)
Definition lua_rng.cpp:70
int impl_rng_seed(lua_State *L)
Definition lua_rng.cpp:61
int impl_rng_destroy(lua_State *L)
Definition lua_rng.cpp:47
void load_tables(lua_State *L)
Creates the metatable for RNG objects, and adds the Rng table which contains the constructor.
Definition lua_rng.cpp:97