The Battle for Wesnoth  1.15.1+dev
Macros | Typedefs | Functions | Variables
mapgen_lua_kernel.cpp File Reference
#include "scripting/mapgen_lua_kernel.hpp"
#include "config.hpp"
#include "game_errors.hpp"
#include "log.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_rng.hpp"
#include "scripting/lua_pathfind_cost_calculator.hpp"
#include "scripting/lua_terrainfilter.hpp"
#include "scripting/lua_terrainmap.hpp"
#include <ostream>
#include <string>
#include "utils/functional.hpp"
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include "scripting/push_check.hpp"
#include "generators/default_map_generator_job.hpp"
Include dependency graph for mapgen_lua_kernel.cpp:

Go to the source code of this file.

Macros

#define ERR_NG   LOG_STREAM(err, log_mapgen)
 
#define LOG_NG   LOG_STREAM(info, log_mapgen)
 
#define DBG_NG   LOG_STREAM(debug, log_mapgen)
 

Typedefs

typedef int(mapgen_lua_kernel::* member_callback) (lua_State *)
 

Functions

template<member_callback method>
int dispatch (lua_State *L)
 
static int intf_random (lua_State *L)
 Returns a random numer, same interface as math.random. More...
 
static int intf_default_generate (lua_State *L)
 calls the default mapgenerator. More...
 
static int intf_default_generate_height_map (lua_State *L)
 calls the default mapgenerator. More...
 
static int intf_find_path (lua_State *L)
 Finds a path between two locations. More...
 

Variables

static lg::log_domain log_mapgen ("mapgen")
 

Macro Definition Documentation

◆ DBG_NG

#define DBG_NG   LOG_STREAM(debug, log_mapgen)

Definition at line 38 of file mapgen_lua_kernel.cpp.

◆ ERR_NG

#define ERR_NG   LOG_STREAM(err, log_mapgen)

Definition at line 36 of file mapgen_lua_kernel.cpp.

◆ LOG_NG

#define LOG_NG   LOG_STREAM(info, log_mapgen)

Definition at line 37 of file mapgen_lua_kernel.cpp.

Typedef Documentation

◆ member_callback

typedef int(mapgen_lua_kernel::* member_callback) (lua_State *)

Definition at line 44 of file mapgen_lua_kernel.cpp.

Function Documentation

◆ dispatch()

template<member_callback method>
int dispatch ( lua_State L)

Definition at line 47 of file mapgen_lua_kernel.cpp.

◆ intf_default_generate()

static int intf_default_generate ( lua_State L)
static

◆ intf_default_generate_height_map()

static int intf_default_generate_height_map ( lua_State L)
static

◆ intf_find_path()

static int intf_find_path ( lua_State L)
static

Finds a path between two locations.

  • Args 1,2: source location.
  • Args 3,4: destination.
  • Arg 5: cost function
  • Args 6,7 size of map.
  • Arg 8 include border.
  • Ret 1: array of pairs containing path steps.
  • Ret 2: path cost.

Definition at line 168 of file mapgen_lua_kernel.cpp.

References pathfind::a_star_search(), i, lua_createtable(), lua_isboolean, lua_isfunction, lua_pushfstring(), lua_pushinteger(), lua_rawseti(), LUA_TFUNCTION, lua_typename(), luaL_argerror(), luaL_checkinteger(), luaL_typename, luaW_toboolean(), pathfind::plain_route::move_cost, wfl::msg(), map_location::set_wml_x(), map_location::set_wml_y(), and pathfind::plain_route::steps.

Referenced by mapgen_lua_kernel::mapgen_lua_kernel().

◆ intf_random()

static int intf_random ( lua_State L)
static

Returns a random numer, same interface as math.random.

Definition at line 54 of file mapgen_lua_kernel.cpp.

References lua_isnoneornil, lua_isnumber(), lua_push(), and luaL_argerror().

Referenced by mapgen_lua_kernel::mapgen_lua_kernel().

Variable Documentation

◆ log_mapgen

lg::log_domain log_mapgen("mapgen")
static