Sort src/ into subsystem folders (engine, game, level, level/grid, entity with player, npc, boss, familiar, effect, pickup and weapon, ui, ui/menu, lua, online), drop each folder's prefix from file names, include by path from src/, glob src/ recursively
This commit is contained in:
1 parent
9254158eef
commit
7d3cf33c20
706 files changed
+5337
-5336
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#include "classes.h"
|
||||
#include "lua/api.h"
|
||||
#include "engine/seeds.h"
|
||||
|
||||
// (008bbcf0) Registers Lua's RNG: a default seeded constructor and the game's RNG methods.
|
||||
void lua_api_rng_register(lua_State* state)
|
||||
{
|
||||
lua_class_begin(state, "RNG", LUA_CLASS_RNG);
|
||||
lua_static(state, "__call", [](LuaIgnored) { return RNG_DEFAULT; });
|
||||
lua_method(state, "GetSeed", [](RNG& rng) { return rng._seed; });
|
||||
lua_method(state, "SetSeed", [](RNG& rng, uint32_t seed, uint32_t shiftIndex) { rng.SetSeed(seed, shiftIndex); });
|
||||
lua_method(state, "RandomInt", [](RNG& rng, uint32_t max) { return rng.RandomInt(max); });
|
||||
lua_method(state, "RandomFloat", [](RNG& rng) { return rng.RandomFloat(); });
|
||||
lua_method(state, "Next", [](RNG& rng) { return rng.Next(); });
|
||||
lua_class_end(state);
|
||||
}
|
||||
Reference in new issue
Block a user